Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
hfern committed Nov 4, 2024
1 parent ba4276a commit 0cb024c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions tf/iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,28 +120,28 @@ class PlanContext(_Context):
class Resource(AbstractResource, Protocol):
def validate(self, diags: Diagnostics, type_name: str, config: Config):
"""
Validate the resource configuration
Validate the resource configuration
This is called before any other operation to validate the configuration of the resource.
You should run parameter validation here.
Generate errors and warnings through the `diags` object.
This is called before any other operation to validate the configuration of the resource.
You should run parameter validation here.
Generate errors and warnings through the `diags` object.
:param diags: Diagnostics
:param type_name: The type name of the resource
:param config: The configuration to validate
:param diags: Diagnostics
:param type_name: The type name of the resource
:param config: The configuration to validate
"""
schema = self.get_schema()
_validate_config(diags, type_name, config, schema.attributes, schema.block_types)

@abstractmethod
def create(self, ctx: CreateContext, planned: State) -> Optional[State]:
"""
Create the resource, returning the actual state after creation.
Create the resource, returning the actual state after creation.
This is called when a user runs `opentofu apply` and the resource needs to be initially created.
This is called when a user runs `opentofu apply` and the resource needs to be initially created.
:param ctx: CreateContext
:param planned: The planned state of the resource
:param ctx: CreateContext
:param planned: The planned state of the resource
"""

@abstractmethod
Expand All @@ -162,12 +162,12 @@ def plan(self, ctx: PlanContext, current: Optional[State], planned: State) -> Op

def import_(self, ctx: ImportContext, id: str) -> Optional[State]:
"""
Import a resource
Import a resource
This is called when a user runs `opentofu import` and provides a resource ID to import.
This is called when a user runs `opentofu import` and provides a resource ID to import.
:param ctx: ImportContext
:param id: The resource ID to import
:param ctx: ImportContext
:param id: The resource ID to import
"""

# TODO(Hunter): move
Expand Down
6 changes: 3 additions & 3 deletions tf/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def intercept_service(self, continuation, handler_call_details):

def run_provider(provider: Provider, argv: Optional[list[str]] = None):
"""
Run the given provider with the given arguments.
Run the given provider with the given arguments.
:param provider: Provider instance to run
:param argv: Optional arguments to run the provider with
:param provider: Provider instance to run
:param argv: Optional arguments to run the provider with
"""

argv = argv or sys.argv
Expand Down

0 comments on commit 0cb024c

Please sign in to comment.