@@ -44,14 +44,19 @@ def aws_run_ore_replicate(build, args):
44
44
if not args .source_region :
45
45
args .source_region = buildmeta ['amis' ][0 ]['name' ]
46
46
47
+ ore_args = ['ore' , 'aws' , '--region' , args .source_region ]
48
+ if args .log_level :
49
+ ore_args .extend (['--log-level' , args .log_level ])
50
+ if args .credentials_file :
51
+ ore_args .extend (['--credentials-file' , args .credentials_file ])
52
+
47
53
# If no region specified then autodetect the regions to replicate to.
48
54
# Specify --region=args.source_region here so ore knows to talk to
49
55
# a region that exists (i.e. it will talk to govcloud if copying
50
56
# from a govcloud region).
51
57
if not args .region :
52
- args .region = subprocess .check_output ([
53
- 'ore' , 'aws' , '--region' , args .source_region , 'list-regions'
54
- ]).decode ().strip ().split ()
58
+ args .region = subprocess .check_output (
59
+ ore_args + ['list-regions' ]).decode ().strip ().split ()
55
60
56
61
# only replicate to regions that don't already exist
57
62
existing_regions = [item ['name' ] for item in buildmeta ['amis' ]]
@@ -75,13 +80,7 @@ def aws_run_ore_replicate(build, args):
75
80
raise Exception (("Unable to find AMI ID for "
76
81
f"{ args .source_region } region" ))
77
82
78
- ore_args = ['ore' ]
79
- if args .log_level :
80
- ore_args .extend (['--log-level' , args .log_level ])
81
- ore_args .extend ([
82
- 'aws' , 'copy-image' , '--image' ,
83
- source_image , '--region' , args .source_region
84
- ])
83
+ ore_args .extend (['copy-image' , '--image' , source_image ])
85
84
ore_args .extend (region_list )
86
85
print ("+ {}" .format (subprocess .list2cmdline (ore_args )))
87
86
0 commit comments