Skip to content

Commit

Permalink
addressing cr and test fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
juandiegopalomino committed Mar 28, 2021
1 parent 4198f4b commit bc67aa5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions opta/core/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def get_credentials(cls) -> Tuple[Credentials, str]:
return cls.credentials, cls.project_id # type: ignore

# Upload the current opta config to the state bucket, under opta_config/.
def upload_opta_config(self, config: str) -> None:
def upload_opta_config(self, config_data: str) -> None:
bucket = self.layer.state_storage()
config_path = f"opta_config/{self.layer.name}"
credentials, project_id = self.get_credentials()
gcs_client = storage.Client(project=project_id, credentials=credentials)
bucket_object = gcs_client.get_bucket(bucket)
blob = storage.Blob(config_path, bucket_object)
blob.upload_from_string(config)
logger.debug("Uploaded opta config to s3")
blob.upload_from_string(config_data)
logger.debug("Uploaded opta config to gcs")
2 changes: 1 addition & 1 deletion tests/commands/test_destroy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_destroy(mocker: MockFixture) -> None:
mocker.patch("opta.commands.destroy.Terraform.destroy_all")

mocker.patch(
"opta.commands.destroy._download_all_opta_configs",
"opta.commands.destroy._aws_download_all_opta_configs",
return_value=[FAKE_ENV_CONFIG, FAKE_SERVICE_CONFIG],
)

Expand Down

0 comments on commit bc67aa5

Please sign in to comment.