summaryrefslogtreecommitdiff
path: root/openstackclient/compute
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/compute')
-rw-r--r--openstackclient/compute/client.py20
-rw-r--r--openstackclient/compute/v2/server.py11
2 files changed, 21 insertions, 10 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py
index 7ca08a4f..93a7b715 100644
--- a/openstackclient/compute/client.py
+++ b/openstackclient/compute/client.py
@@ -15,14 +15,6 @@
import logging
-from novaclient import client as nova_client
-from novaclient import extension
-
-try:
- from novaclient.v2.contrib import list_extensions
-except ImportError:
- from novaclient.v1_1.contrib import list_extensions
-
from openstackclient.common import utils
LOG = logging.getLogger(__name__)
@@ -30,10 +22,22 @@ LOG = logging.getLogger(__name__)
DEFAULT_COMPUTE_API_VERSION = '2'
API_VERSION_OPTION = 'os_compute_api_version'
API_NAME = 'compute'
+API_VERSIONS = {
+ "2": "novaclient.client",
+}
def make_client(instance):
"""Returns a compute service client."""
+
+ # Defer client imports until we actually need them
+ from novaclient import client as nova_client
+ from novaclient import extension
+ try:
+ from novaclient.v2.contrib import list_extensions
+ except ImportError:
+ from novaclient.v1_1.contrib import list_extensions
+
compute_client = nova_client.get_client_class(
instance._api_version[API_NAME],
)
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 49ef18b2..e4e96ee7 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -275,10 +275,17 @@ class CreateServer(show.ShowOne):
)
parser.add_argument(
'--nic',
- metavar='<nic-config-string>',
+ metavar="<net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,"
+ "port-id=port-uuid>",
action='append',
default=[],
- help=_('Specify NIC configuration (optional extension)'),
+ help=_("Create a NIC on the server. "
+ "Specify option multiple times to create multiple NICs. "
+ "Either net-id or port-id must be provided, but not both. "
+ "net-id: attach NIC to network with this UUID, "
+ "port-id: attach NIC to port with this UUID, "
+ "v4-fixed-ip: IPv4 fixed address for NIC (optional), "
+ "v6-fixed-ip: IPv6 fixed address for NIC (optional)."),
)
parser.add_argument(
'--hint',