if not self.name:
raise RouterConfigError('Name is required')
- def dict_for_neutron(self, neutron, os_creds):
+ def dict_for_neutron(self, neutron, os_creds, project_id):
"""
Returns a dictionary object representing this object.
This is meant to be converted into JSON designed for use by the Neutron
TODO - expand automated testing to exercise all parameters
:param neutron: The neutron client to retrieve external network
information if necessary
- :param os_creds: The OpenStack credentials
+ :param os_creds: The OpenStack credentials for retrieving the keystone
+ client for looking up the project ID when the
+ self.project_name is not None
+ :param project_id: the associated project ID to use when
+ self.project_name is None
:return: the dictionary object
"""
out = dict()
keystone = keystone_utils.keystone_client(os_creds)
project = keystone_utils.get_project(
keystone=keystone, project_name=self.project_name)
- project_id = None
if project:
project_id = project.id
if project_id: