Adds insecure option to launch_node.py

Added the abillity to use launch_node.py to connect to and create 
infrastructure instances in openstack setups that are not setup to use 
the ssl secured clients.

This matches the functionality of the nova cli to accept NOVACLIENT_INSECURE.

Change-Id: Ibfb5bb4665f36a155ec488c475e03f9cd901e9d6
Signed-off-by: Philip Schwartz <philip.schwartz@rackspace.com>
This commit is contained in:
Philip Schwartz 2014-04-10 15:46:24 -04:00 committed by James E. Blair
parent 00a2f40bb5
commit 7590fa4e29

View File

@ -33,6 +33,7 @@ NOVA_PASSWORD = os.environ['OS_PASSWORD']
NOVA_URL = os.environ['OS_AUTH_URL']
NOVA_PROJECT_ID = os.environ['OS_TENANT_NAME']
NOVA_REGION_NAME = os.environ['OS_REGION_NAME']
NOVACLIENT_INSECURE = os.getenv('NOVACLIENT_INSECURE', None)
IPV6 = os.environ.get('IPV6', '0') is 1
SCRIPT_DIR = os.path.dirname(sys.argv[0])
@ -46,6 +47,10 @@ def get_client():
kwargs = {}
kwargs['region_name'] = NOVA_REGION_NAME
kwargs['service_type'] = 'compute'
if NOVACLIENT_INSECURE:
kwargs['insecure'] = True
from novaclient.v1_1.client import Client
client = Client(*args, **kwargs)
return client