Enable v3 api code

Add mappings to enable v3 code

bp v3-api

Change-Id: I035e5b9d65c06ce5691573832bb9b6c4c705b121
This commit is contained in:
Ben Nemec 2013-08-06 12:48:24 -05:00
parent c0e6d24819
commit 211dfe6ea7
3 changed files with 6 additions and 2 deletions

View File

@ -429,6 +429,7 @@ def get_client_class(version):
version_map = {
'1.1': 'novaclient.v1_1.client.Client',
'2': 'novaclient.v1_1.client.Client',
'3': 'novaclient.v3.client.Client',
}
try:
client_path = version_map[str(version)]

View File

@ -56,6 +56,7 @@ import novaclient.extension
from novaclient.openstack.common import strutils
from novaclient import utils
from novaclient.v1_1 import shell as shell_v1_1
from novaclient.v3 import shell as shell_v3
DEFAULT_OS_COMPUTE_API_VERSION = "1.1"
DEFAULT_NOVA_ENDPOINT_TYPE = 'publicURL'
@ -353,7 +354,8 @@ class OpenStackComputeShell(object):
metavar='<compute-api-ver>',
default=utils.env('OS_COMPUTE_API_VERSION',
default=DEFAULT_OS_COMPUTE_API_VERSION),
help='Accepts 1.1, defaults to env[OS_COMPUTE_API_VERSION].')
help='Accepts 1.1 or 3, '
'defaults to env[OS_COMPUTE_API_VERSION].')
parser.add_argument('--os_compute_api_version',
help=argparse.SUPPRESS)
@ -394,6 +396,7 @@ class OpenStackComputeShell(object):
actions_module = {
'1.1': shell_v1_1,
'2': shell_v1_1,
'3': shell_v3,
}[version]
except KeyError:
actions_module = shell_v1_1

View File

@ -14,4 +14,4 @@
# License for the specific language governing permissions and limitations
# under the License.
from novaclient.v1_1.client import Client # noqa
from novaclient.v3.client import Client # noqa