Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Commit

Permalink
Rebase to master
Browse files Browse the repository at this point in the history
  • Loading branch information
karajan1001 committed Oct 14, 2021
1 parent 59510c5 commit 19abda5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 2 additions & 4 deletions tests/test_terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ def test_state_mv(tmp_path, resource):
mtype = "iterative_machine"

tf = TerraformBackend(tmp_path)
tf.state_mv(
name=resource, source=f"{mtype}.{resource}", destination=f"{mtype}.{new_name}"
)
tf.state_mv(source=f"{mtype}.{resource}", destination=f"{mtype}.{new_name}")

with open(tmp_path / resource / "terraform.tfstate") as fobj:
with open(tmp_path / "terraform.tfstate") as fobj:
tfstate = json.load(fobj)
assert tfstate["resources"][0]["name"] == new_name
6 changes: 1 addition & 5 deletions tpi/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,4 @@ def state_mv(self, source, destination, **kwargs):
different resource instance address.
"""
assert source and destination

name = source.split(".")[-1]

with self.make_tf(name) as tf:
tf.cmd("state mv", source, destination)
self.tf.cmd("state mv", source, destination)

0 comments on commit 19abda5

Please sign in to comment.