Skip to content

Commit

Permalink
Cisco cli cannot find argument action_prefix
Browse files Browse the repository at this point in the history
Bug #1012502

Removed use of argument action_prefix for Client. Also, made HOST, PORT and USE_SSL global.
Signed-off-by: Harsh Prasad <prasad.tanay@gmail.com>

Change-Id: I93037b34fca89786778a2dcd8a3afc80df5687f8
  • Loading branch information
harspras committed Jun 14, 2012
1 parent 44f66c7 commit 7b9a0b7
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions quantum/plugins/cisco/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@


FORMAT = 'json'
ACTION_PREFIX_EXT = '/v1.0'
ACTION_PREFIX_CSCO = ACTION_PREFIX_EXT + \
'/extensions/csco/tenants/{tenant_id}'
#ACTION_PREFIX_EXT = '/v1.0'
#ACTION_PREFIX_CSCO = ACTION_PREFIX_EXT + \
# '/extensions/csco/tenants/{tenant_id}'
VERSION = '1.0'
URI_PREFIX_EXT = ''
URI_PREFIX_CSCO = '/extensions/csco/tenants/{tenant_id}'
TENANT_ID = 'nova'
CSCO_EXT_NAME = 'Cisco Nova Tenant'
DEFAULT_QUANTUM_VERSION = '1.1'
Expand Down Expand Up @@ -81,7 +84,7 @@ def list_extensions(*args):
"""Invoking the action to get the supported extensions"""
request_url = "/extensions"
client = Client(HOST, PORT, USE_SSL, format='json',
action_prefix=ACTION_PREFIX_EXT, tenant="dummy")
version=VERSION, uri_prefix=URI_PREFIX_EXT, tenant="dummy")
data = client.do_request('GET', request_url)
print("Obtained supported extensions from Quantum: %s" % data)

Expand All @@ -102,7 +105,7 @@ def schedule_host(tenant_id, instance_id, user_id=None):

request_url = "/novatenants/" + project_id + "/schedule_host"
client = Client(HOST, PORT, USE_SSL, format='json', tenant=TENANT_ID,
action_prefix=ACTION_PREFIX_CSCO)
version=VERSION, uri_prefix=URI_PREFIX_CSCO)
data = client.do_request('PUT', request_url, body=instance_data_dict)

hostname = data["host_list"]["host_1"]
Expand All @@ -124,7 +127,7 @@ def create_multiport(tenant_id, net_id_list, *args):

request_url = "/multiport"
client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id,
action_prefix=ACTION_PREFIX_CSCO)
version=VERSION, uri_prefix=URI_PREFIX_CSCO)
data = client.do_request('POST', request_url, body=ports_info)

print("Created ports: %s" % data)
Expand Down

0 comments on commit 7b9a0b7

Please sign in to comment.