Network CRUD
bp/neutron https://wiki.openstack.org/wiki/OpenStackClient/Commands#Network_2 Change-Id: I89ee083154afa544b03587e84becace36d9d522a
This commit is contained in:
parent
beda3d90e5
commit
05d799fe63
@ -84,6 +84,16 @@ def format_dict(data):
|
||||
return output[:-2]
|
||||
|
||||
|
||||
def format_list(data):
|
||||
"""Return a formatted strings
|
||||
|
||||
:param data: a list of strings
|
||||
:rtype: a string formatted to a,b,c
|
||||
"""
|
||||
|
||||
return ', '.join(data)
|
||||
|
||||
|
||||
def get_item_properties(item, fields, mixed_case_fields=[], formatters={}):
|
||||
"""Return a tuple containing the item properties.
|
||||
|
||||
|
@ -52,6 +52,7 @@ class FakeClientManager(object):
|
||||
self.image = None
|
||||
self.object = None
|
||||
self.volume = None
|
||||
self.network = None
|
||||
self.auth_ref = None
|
||||
|
||||
|
||||
|
@ -39,11 +39,13 @@ DEFAULT_COMPUTE_API_VERSION = "2"
|
||||
DEFAULT_IDENTITY_API_VERSION = "2.0"
|
||||
DEFAULT_IMAGE_API_VERSION = "v2"
|
||||
DEFAULT_VOLUME_API_VERSION = "1"
|
||||
DEFAULT_NETWORK_API_VERSION = "2.0"
|
||||
|
||||
LIB_COMPUTE_API_VERSION = "2"
|
||||
LIB_IDENTITY_API_VERSION = "2.0"
|
||||
LIB_IMAGE_API_VERSION = "1"
|
||||
LIB_VOLUME_API_VERSION = "1"
|
||||
LIB_NETWORK_API_VERSION = "2.0"
|
||||
|
||||
|
||||
def make_shell():
|
||||
@ -128,6 +130,8 @@ class TestShell(utils.TestCase):
|
||||
default_args["image_api_version"])
|
||||
self.assertEqual(_shell.options.os_volume_api_version,
|
||||
default_args["volume_api_version"])
|
||||
self.assertEqual(_shell.options.os_network_api_version,
|
||||
default_args["network_api_version"])
|
||||
|
||||
|
||||
class TestShellHelp(TestShell):
|
||||
@ -455,6 +459,7 @@ class TestShellCli(TestShell):
|
||||
"OS_IDENTITY_API_VERSION": DEFAULT_IDENTITY_API_VERSION,
|
||||
"OS_IMAGE_API_VERSION": DEFAULT_IMAGE_API_VERSION,
|
||||
"OS_VOLUME_API_VERSION": DEFAULT_VOLUME_API_VERSION,
|
||||
"OS_NETWORK_API_VERSION": DEFAULT_NETWORK_API_VERSION,
|
||||
}
|
||||
self.orig_env, os.environ = os.environ, env.copy()
|
||||
|
||||
@ -475,7 +480,8 @@ class TestShellCli(TestShell):
|
||||
"compute_api_version": DEFAULT_COMPUTE_API_VERSION,
|
||||
"identity_api_version": DEFAULT_IDENTITY_API_VERSION,
|
||||
"image_api_version": DEFAULT_IMAGE_API_VERSION,
|
||||
"volume_api_version": DEFAULT_VOLUME_API_VERSION
|
||||
"volume_api_version": DEFAULT_VOLUME_API_VERSION,
|
||||
"network_api_version": DEFAULT_NETWORK_API_VERSION,
|
||||
}
|
||||
self._assert_cli(flag, kwargs)
|
||||
|
||||
@ -486,6 +492,7 @@ class TestShellCli(TestShell):
|
||||
"compute_api_version": LIB_COMPUTE_API_VERSION,
|
||||
"identity_api_version": LIB_IDENTITY_API_VERSION,
|
||||
"image_api_version": LIB_IMAGE_API_VERSION,
|
||||
"volume_api_version": LIB_VOLUME_API_VERSION
|
||||
"volume_api_version": LIB_VOLUME_API_VERSION,
|
||||
"network_api_version": LIB_NETWORK_API_VERSION
|
||||
}
|
||||
self._assert_cli(flag, kwargs)
|
||||
|
@ -6,5 +6,6 @@ python-glanceclient>=0.9.0
|
||||
python-keystoneclient>=0.9.0
|
||||
python-novaclient>=2.17.0
|
||||
python-cinderclient>=1.0.6
|
||||
python-neutronclient>=2.3.4,<3
|
||||
requests>=1.1
|
||||
six>=1.7.0
|
||||
|
@ -33,6 +33,7 @@ openstack.cli.extension =
|
||||
image = openstackclient.image.client
|
||||
object_store = openstackclient.object.client
|
||||
volume = openstackclient.volume.client
|
||||
network = openstackclient.network.client
|
||||
|
||||
openstack.common =
|
||||
limits_show = openstackclient.common.limits:ShowLimits
|
||||
@ -289,6 +290,13 @@ openstack.volume.v1 =
|
||||
volume_type_set = openstackclient.volume.v1.type:SetVolumeType
|
||||
volume_type_unset = openstackclient.volume.v1.type:UnsetVolumeType
|
||||
|
||||
openstack.network.v2_0 =
|
||||
network_create = openstackclient.network.v2_0.network:CreateNetwork
|
||||
network_delete = openstackclient.network.v2_0.network:DeleteNetwork
|
||||
network_list = openstackclient.network.v2_0.network:ListNetwork
|
||||
network_set = openstackclient.network.v2_0.network:SetNetwork
|
||||
network_show = openstackclient.network.v2_0.network:ShowNetwork
|
||||
|
||||
[build_sphinx]
|
||||
source-dir = doc/source
|
||||
build-dir = doc/build
|
||||
|
Loading…
x
Reference in New Issue
Block a user