Clean imports in code
This patch set modifies lines which are importing objects instead of modules. As per openstack import guide lines, user should import modules in a file not objects. http://docs.openstack.org/developer/hacking/#imports Change-Id: I4bb564a0fbcd03402ae157079736c3f8d300f987
This commit is contained in:
parent
51a9997204
commit
033ba0434b
|
@ -4,6 +4,8 @@
|
|||
# openstack --os-cloud=bifrost baremetal node list -f yaml --noindent \
|
||||
# --fields name instance_info | python nodelist_to_inventory.py
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import yaml
|
||||
|
||||
|
@ -16,4 +18,4 @@ for node in nodes:
|
|||
groups[tag] = {}
|
||||
ip = node['Instance Info']['ipv4_address']
|
||||
groups[tag][node['Name']] = {'ip': ip}
|
||||
print yaml.dump(groups, indent=2, default_flow_style=False)
|
||||
print(yaml.dump(groups, indent=2, default_flow_style=False))
|
||||
|
|
|
@ -4,7 +4,7 @@ import os
|
|||
import sys
|
||||
|
||||
from devops.helpers.templates import yaml_template_load
|
||||
from devops.models import Environment
|
||||
from devops import models
|
||||
|
||||
|
||||
def create_config():
|
||||
|
@ -44,7 +44,7 @@ def _get_free_eth_interface(node):
|
|||
def get_env():
|
||||
env = os.environ
|
||||
env_name = env['ENV_NAME']
|
||||
return Environment.get(name=env_name)
|
||||
return models.Environment.get(name=env_name)
|
||||
|
||||
|
||||
def get_master_ip(env):
|
||||
|
@ -71,7 +71,7 @@ def get_bridged_iface_mac(env, ip):
|
|||
|
||||
|
||||
def define_from_config(conf):
|
||||
env = Environment.create_environment(conf)
|
||||
env = models.Environment.create_environment(conf)
|
||||
env.define()
|
||||
env.start()
|
||||
|
||||
|
|
Loading…
Reference in New Issue