diff --git a/fedimg/services/ec2/ec2imguploader.py b/fedimg/services/ec2/ec2imguploader.py index 0870d27..eab46eb 100644 --- a/fedimg/services/ec2/ec2imguploader.py +++ b/fedimg/services/ec2/ec2imguploader.py @@ -166,7 +166,7 @@ def _create_volume(self, source): if self.volume_via_s3: output, err, retcode = external_run_command([ 'euca-import-volume', - source, + source[5:], '-f', self.image_format, '--region', diff --git a/fedimg/utils.py b/fedimg/utils.py index 27bb2c6..2fd0a0f 100644 --- a/fedimg/utils.py +++ b/fedimg/utils.py @@ -108,6 +108,8 @@ def get_value_from_dict(_dict, *keys): def external_run_command(command): + if command[0] == 'euca-import-volume': + os.chdir('/tmp') _log.info("Starting the command: %r" % command) ret = subprocess.Popen(' '.join(command), stdin=subprocess.PIPE, shell=True, stdout=subprocess.PIPE,