from os import environ as env

from glanceclient import Client as glclient
import keystoneclient.v2_0.client as ksclient
import novaclient.v2.client as nvclient


client_args = {
        }

nova = nvclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        api_key=env['OS_PASSWORD'],
        project_id=env['OS_TENANT_NAME'])

keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        password=env['OS_PASSWORD'],
        tenant_name=env['OS_TENANT_NAME'],)

glance_endpoint = keystone.service_catalog.url_for(service_type='image')
glance = glclient(version=2, endpoint=glance_endpoint, token=keystone.auth_token)

from os import environ as env

from glanceclient import Client as glclient
import keystoneclient.v2_0.client as ksclient
import novaclient.client as nvclient


client_args = {
        }

nova = nvclient.Client('2', env['OS_USERNAME'], env['OS_PASSWORD'], env['OS_TENANT_NAME'], env['OS_AUTH_URL'])

keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        password=env['OS_PASSWORD'],
        tenant_name=env['OS_TENANT_NAME'],)

glance_endpoint = keystone.service_catalog.url_for(service_type='image')
glance = glclient(version=2, endpoint=glance_endpoint, token=keystone.auth_token)

Fix nova client usage, it should not be initialized this way
Fix nova client usage, it should not be initialized this way

  from os import environ as env
  
  from glanceclient import Client as glclient
  import keystoneclient.v2_0.client as ksclient
- import novaclient.v2.client as nvclient
+ import novaclient.client as nvclient
  
  
  client_args = {
          }
  
+ nova = nvclient.Client('2', env['OS_USERNAME'], env['OS_PASSWORD'], env['OS_TENANT_NAME'], env['OS_AUTH_URL'])
- nova = nvclient.Client(auth_url=env['OS_AUTH_URL'],
-         username=env['OS_USERNAME'],
-         api_key=env['OS_PASSWORD'],
-         project_id=env['OS_TENANT_NAME'])
  
  keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
          username=env['OS_USERNAME'],
          password=env['OS_PASSWORD'],
          tenant_name=env['OS_TENANT_NAME'],)
  
  glance_endpoint = keystone.service_catalog.url_for(service_type='image')
  glance = glclient(version=2, endpoint=glance_endpoint, token=keystone.auth_token)
  
Fix nova client usage, it should not be initialized this way
## Code Before:
from os import environ as env

from glanceclient import Client as glclient
import keystoneclient.v2_0.client as ksclient
import novaclient.v2.client as nvclient


client_args = {
        }

nova = nvclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        api_key=env['OS_PASSWORD'],
        project_id=env['OS_TENANT_NAME'])

keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        password=env['OS_PASSWORD'],
        tenant_name=env['OS_TENANT_NAME'],)

glance_endpoint = keystone.service_catalog.url_for(service_type='image')
glance = glclient(version=2, endpoint=glance_endpoint, token=keystone.auth_token)

## Instruction:
Fix nova client usage, it should not be initialized this way
## Code After:
from os import environ as env

from glanceclient import Client as glclient
import keystoneclient.v2_0.client as ksclient
import novaclient.client as nvclient


client_args = {
        }

nova = nvclient.Client('2', env['OS_USERNAME'], env['OS_PASSWORD'], env['OS_TENANT_NAME'], env['OS_AUTH_URL'])

keystone = ksclient.Client(auth_url=env['OS_AUTH_URL'],
        username=env['OS_USERNAME'],
        password=env['OS_PASSWORD'],
        tenant_name=env['OS_TENANT_NAME'],)

glance_endpoint = keystone.service_catalog.url_for(service_type='image')
glance = glclient(version=2, endpoint=glance_endpoint, token=keystone.auth_token)
