@@ -109,6 +109,8 @@ def _get_attrs(client_manager, parsed_args):
109109 'The --host-id option is deprecated, '
110110 'please use --host instead.'
111111 ))
112+ if parsed_args .description is not None :
113+ attrs ['description' ] = parsed_args .description
112114 if parsed_args .fixed_ip is not None :
113115 attrs ['fixed_ips' ] = parsed_args .fixed_ip
114116 if parsed_args .device :
@@ -180,46 +182,51 @@ def _prepare_fixed_ips(client_manager, parsed_args):
180182
181183
182184def _add_updatable_args (parser ):
183- # NOTE(dtroyer): --device-id is deprecated in Mar 2016. Do not
184- # remove before 3.x release or Mar 2017.
185- device_group = parser .add_mutually_exclusive_group ()
186- device_group .add_argument (
187- '--device' ,
188- metavar = '<device-id>' ,
189- help = _ ("Port device ID" )
190- )
191- device_group .add_argument (
192- '--device-id' ,
193- metavar = '<device-id>' ,
194- help = argparse .SUPPRESS ,
195- )
196- parser .add_argument (
197- '--device-owner' ,
198- metavar = '<device-owner>' ,
199- help = _ ("Device owner of this port. This is the entity that uses "
200- "the port (for example, network:dhcp)." )
201- )
202- parser .add_argument (
203- '--vnic-type' ,
204- metavar = '<vnic-type>' ,
205- choices = ['direct' , 'direct-physical' , 'macvtap' ,
206- 'normal' , 'baremetal' ],
207- help = _ ("VNIC type for this port (direct | direct-physical | "
208- "macvtap | normal | baremetal, default: normal)" )
209- )
210- # NOTE(dtroyer): --host-id is deprecated in Mar 2016. Do not
211- # remove before 3.x release or Mar 2017.
212- host_group = parser .add_mutually_exclusive_group ()
213- host_group .add_argument (
214- '--host' ,
215- metavar = '<host-id>' ,
216- help = _ ("Allocate port on host <host-id> (ID only)" )
217- )
218- host_group .add_argument (
219- '--host-id' ,
220- metavar = '<host-id>' ,
221- help = argparse .SUPPRESS ,
222- )
185+ parser .add_argument (
186+ '--description' ,
187+ metavar = '<description>' ,
188+ help = _ ("Description of this port" )
189+ )
190+ # NOTE(dtroyer): --device-id is deprecated in Mar 2016. Do not
191+ # remove before 3.x release or Mar 2017.
192+ device_group = parser .add_mutually_exclusive_group ()
193+ device_group .add_argument (
194+ '--device' ,
195+ metavar = '<device-id>' ,
196+ help = _ ("Port device ID" )
197+ )
198+ device_group .add_argument (
199+ '--device-id' ,
200+ metavar = '<device-id>' ,
201+ help = argparse .SUPPRESS ,
202+ )
203+ parser .add_argument (
204+ '--device-owner' ,
205+ metavar = '<device-owner>' ,
206+ help = _ ("Device owner of this port. This is the entity that uses "
207+ "the port (for example, network:dhcp)." )
208+ )
209+ parser .add_argument (
210+ '--vnic-type' ,
211+ metavar = '<vnic-type>' ,
212+ choices = ['direct' , 'direct-physical' , 'macvtap' ,
213+ 'normal' , 'baremetal' ],
214+ help = _ ("VNIC type for this port (direct | direct-physical | "
215+ "macvtap | normal | baremetal, default: normal)" )
216+ )
217+ # NOTE(dtroyer): --host-id is deprecated in Mar 2016. Do not
218+ # remove before 3.x release or Mar 2017.
219+ host_group = parser .add_mutually_exclusive_group ()
220+ host_group .add_argument (
221+ '--host' ,
222+ metavar = '<host-id>' ,
223+ help = _ ("Allocate port on host <host-id> (ID only)" )
224+ )
225+ host_group .add_argument (
226+ '--host-id' ,
227+ metavar = '<host-id>' ,
228+ help = argparse .SUPPRESS ,
229+ )
223230
224231
225232class CreatePort (command .ShowOne ):
0 commit comments