def get_expected_result(self): expected_url = 'https://s3.amazonaws.com/{0}/{1}'.\ format(self.bucket_name, get_s3_path(self.template_path)) return {'Description': self.product_description, 'Distributor': self.product_distributor, 'IdempotencyToken': mock.ANY, 'Name': self.product_name, 'Owner': self.product_owner, 'ProductType': self.product_type, 'ProvisioningArtifactParameters': { 'Description': self.provisioning_artifact_description, 'Info': {'LoadTemplateFromURL': expected_url}, 'Name': self.provisioning_artifact_name, 'Type': self.provisioning_artifact_type}, 'SupportDescription': self.support_description, 'SupportEmail': self.support_email, 'Tags': [ { "Value": "value1", "Key": "key1" }, { "Value": "value2", "Key": "key2" }, { "Value": "value3", "Key": "key3" } ]}
def get_expected_result(self): expected_url = 'https://s3.amazonaws.com/{0}/{1}'.\ format(self.bucket_name, get_s3_path(self.template_path)) return {'Description': self.product_description, 'Distributor': self.product_distributor, 'IdempotencyToken': mock.ANY, 'Name': self.product_name, 'Owner': self.product_owner, 'ProductType': self.product_type, 'ProvisioningArtifactParameters': { 'Description': self.provisioning_artifact_description, 'Info': {'LoadTemplateFromURL': expected_url}, 'Name': self.provisioning_artifact_name, 'Type': self.provisioning_artifact_type}, 'SupportDescription': self.support_description, 'SupportEmail': self.support_email, 'Tags': [ { "Value": "value1", "Key": "key1" }, { "Value": "value2", "Key": "key2" }, { "Value": "value3", "Key": "key3" } ]}
def _run_main(self, parsed_args, parsed_globals): self.region = self.get_and_validate_region(parsed_globals) self.s3_client = self._session.create_client( 's3', region_name=self.region, endpoint_url=parsed_globals.endpoint_url, verify=parsed_globals.verify_ssl ) self.s3_uploader = S3Uploader(self.s3_client, parsed_args.bucket_name, self.region, force_upload=True) self.s3_uploader.upload(parsed_args.file_path, get_s3_path(parsed_args.file_path))
def _run_main(self, parsed_args, parsed_globals): self.region = self.get_and_validate_region(parsed_globals) self.s3_client = self._session.create_client( 's3', region_name=self.region, endpoint_url=parsed_globals.endpoint_url, verify=parsed_globals.verify_ssl) self.s3_uploader = S3Uploader(self.s3_client, parsed_args.bucket_name, force_upload=True) try: self.s3_uploader.upload(parsed_args.file_path, get_s3_path(parsed_args.file_path)) except OSError as ex: raise RuntimeError("%s cannot be found" % parsed_args.file_path)
def get_expected_result(self): expected_url = 'https://s3.amazonaws.com/{0}/{1}'. \ format(self.bucket_name, get_s3_path(self.template_path)) return { 'IdempotencyToken': mock.ANY, 'Parameters': { 'Description': self.provisioning_artifact_description, 'Info': { 'LoadTemplateFromURL': expected_url }, 'Name': self.provisioning_artifact_name, 'Type': self.provisioning_artifact_type }, 'ProductId': self.product_id }
def get_expected_result(self): expected_url = 'https://s3.amazonaws.com/{0}/{1}'. \ format(self.bucket_name, get_s3_path(self.template_path)) return { 'IdempotencyToken': mock.ANY, 'Parameters': { 'Description': self.provisioning_artifact_description, 'Info': { 'LoadTemplateFromURL': expected_url }, 'Name': self.provisioning_artifact_name, 'Type': self.provisioning_artifact_type }, 'ProductId': self.product_id }
def _run_main(self, parsed_args, parsed_globals): self.region = self.get_and_validate_region(parsed_globals) self.s3_client = self._session.create_client( 's3', region_name=self.region, endpoint_url=parsed_globals.endpoint_url, verify=parsed_globals.verify_ssl ) self.s3_uploader = S3Uploader(self.s3_client, parsed_args.bucket_name, self.region, force_upload=True) try: self.s3_uploader.upload(parsed_args.file_path, get_s3_path(parsed_args.file_path)) except OSError as ex: raise RuntimeError("%s cannot be found" % parsed_args.file_path)
def create_s3_url(self, bucket_name, file_path): return make_url(self.region, bucket_name, get_s3_path(file_path))