@@ -205,6 +205,16 @@ def get_parser(self, prog_name):
205205 action = "store_true" ,
206206 help = _ ("Image is inaccessible to the public (default)" ),
207207 )
208+ public_group .add_argument (
209+ "--community" ,
210+ action = "store_true" ,
211+ help = _ ("Image is accessible to the community" ),
212+ )
213+ public_group .add_argument (
214+ "--shared" ,
215+ action = "store_true" ,
216+ help = _ ("Image can be shared" ),
217+ )
208218 parser .add_argument (
209219 "--property" ,
210220 dest = "properties" ,
@@ -260,7 +270,7 @@ def take_action(self, parsed_args):
260270 kwargs = {}
261271 copy_attrs = ('name' , 'id' ,
262272 'container_format' , 'disk_format' ,
263- 'min_disk' , 'min_ram' , 'tags' )
273+ 'min_disk' , 'min_ram' , 'tags' , 'visibility' )
264274 for attr in copy_attrs :
265275 if attr in parsed_args :
266276 val = getattr (parsed_args , attr , None )
@@ -288,7 +298,10 @@ def take_action(self, parsed_args):
288298 kwargs ['visibility' ] = 'public'
289299 if parsed_args .private :
290300 kwargs ['visibility' ] = 'private'
291-
301+ if parsed_args .community :
302+ kwargs ['visibility' ] = 'community'
303+ if parsed_args .shared :
304+ kwargs ['visibility' ] = 'shared'
292305 # Handle deprecated --owner option
293306 project_arg = parsed_args .project
294307 if parsed_args .owner :
@@ -698,6 +711,16 @@ def get_parser(self, prog_name):
698711 action = "store_true" ,
699712 help = _ ("Image is inaccessible to the public (default)" ),
700713 )
714+ public_group .add_argument (
715+ "--community" ,
716+ action = "store_true" ,
717+ help = _ ("Image is accessible to the community" ),
718+ )
719+ public_group .add_argument (
720+ "--shared" ,
721+ action = "store_true" ,
722+ help = _ ("Image can be shared" ),
723+ )
701724 parser .add_argument (
702725 "--property" ,
703726 dest = "properties" ,
@@ -817,7 +840,7 @@ def take_action(self, parsed_args):
817840 copy_attrs = ('architecture' , 'container_format' , 'disk_format' ,
818841 'file' , 'instance_id' , 'kernel_id' , 'locations' ,
819842 'min_disk' , 'min_ram' , 'name' , 'os_distro' , 'os_version' ,
820- 'prefix' , 'progress' , 'ramdisk_id' , 'tags' )
843+ 'prefix' , 'progress' , 'ramdisk_id' , 'tags' , 'visibility' )
821844 for attr in copy_attrs :
822845 if attr in parsed_args :
823846 val = getattr (parsed_args , attr , None )
@@ -845,7 +868,10 @@ def take_action(self, parsed_args):
845868 kwargs ['visibility' ] = 'public'
846869 if parsed_args .private :
847870 kwargs ['visibility' ] = 'private'
848-
871+ if parsed_args .community :
872+ kwargs ['visibility' ] = 'community'
873+ if parsed_args .shared :
874+ kwargs ['visibility' ] = 'shared'
849875 # Handle deprecated --owner option
850876 project_arg = parsed_args .project
851877 if parsed_args .owner :
0 commit comments