Skip to content
This repository was archived by the owner on Sep 13, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/test_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ def terraform(tmp_path, mocker):

@pytest.fixture
def resource(tmp_path):
name = "test-resource"
path = tmp_path / "terraform.tfstate"
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(TEST_RESOURCE_STATE, encoding="utf-8")
yield name
yield "test-resource"
Comment on lines -67 to +70
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function resource refactored with the following changes:



def test_run_cmd(mocker):
Expand Down
4 changes: 1 addition & 3 deletions tpi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ def render_json(indent=None, **config) -> str:
assert "name" in config and "cloud" in config
tf_config = OrderedDict(BASE_CONFIG)
name = config["name"]
resource = {
name: {key: value for key, value in config.items()},
}
resource = {name: dict(config.items())}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function render_json refactored with the following changes:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resource = {
name: {key: value for key, value in config.items()},
}
resource = {name: dict(config.items())}
resource = {name: dict(config)}

tf_config["resource"] = {"iterative_machine": resource}
return json.dumps(tf_config, indent=indent)
3 changes: 1 addition & 2 deletions tpi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@


def get_main_parser():
parser = argparse.ArgumentParser(prog="tpi")
return parser
return argparse.ArgumentParser(prog="tpi")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_main_parser refactored with the following changes:



def main(argv=None):
Expand Down