def args2body(self, parsed_args, body=None):
        """Add in conditional args and then return all conn info."""

        if body is None:
            body = {}
        if parsed_args.dpd:
            vpn_utils.validate_dpd_dict(parsed_args.dpd)
            body['dpd'] = parsed_args.dpd
        if parsed_args.local_ep_group:
            _local_epg = neutronv20.find_resourceid_by_name_or_id(
                self.get_client(), 'endpoint_group',
                parsed_args.local_ep_group)
            body['local_ep_group_id'] = _local_epg
        if parsed_args.peer_ep_group:
            _peer_epg = neutronv20.find_resourceid_by_name_or_id(
                self.get_client(), 'endpoint_group',
                parsed_args.peer_ep_group)
            body['peer_ep_group_id'] = _peer_epg
        return {self.resource: body}
def args2body ( self , parsed_args , body = None ) : if body is None : body = { } if parsed_args . dpd : vpn_utils . validate_dpd_dict ( parsed_args . dpd ) body [ 'dpd' ] = parsed_args . dpd if parsed_args . local_ep_group : _local_epg = neutronv20 . find_resourceid_by_name_or_id ( self . get_client ( ) , 'endpoint_group' , parsed_args . local_ep_group ) body [ 'local_ep_group_id' ] = _local_epg if parsed_args . peer_ep_group : _peer_epg = neutronv20 . find_resourceid_by_name_or_id ( self . get_client ( ) , 'endpoint_group' , parsed_args . peer_ep_group ) body [ 'peer_ep_group_id' ] = _peer_epg return { self . resource : body }
Add in conditional args and then return all conn info.