py3 (2) - update host.py to py3 compatibility
- py3 is more particular about external package imports; specify kollacli utils explicitly - fix typo on oslo.utils in requirements.txt - use standard spec for oslo utils - !=2.6.0,>=2.4.0
This commit is contained in:
parent
538cfddf60
commit
d1e67d88ce
|
@ -43,7 +43,7 @@ Requires: python-cliff >= 1.13.0
|
|||
Requires: python-cliff-tablib >= 1.1
|
||||
Requires: python-jsonpickle >= 0.9.2
|
||||
Requires: python-oslo-i18n >= 2.5.0
|
||||
Requires: python-oslo-utils >= 2.7.0
|
||||
Requires: python-oslo-utils !=2.6.0, >=2.4.0
|
||||
Requires: python-paramiko >= 1.15.1
|
||||
Requires: python-pbr >= 1.6.0
|
||||
Requires: python-six >= 1.9.0
|
||||
|
|
|
@ -16,7 +16,6 @@ import getpass
|
|||
import logging
|
||||
import os
|
||||
import traceback
|
||||
import utils
|
||||
import yaml
|
||||
|
||||
from kollacli.ansible.inventory import Inventory
|
||||
|
@ -50,7 +49,7 @@ class HostAdd(Command):
|
|||
def take_action(self, parsed_args):
|
||||
try:
|
||||
hostname = parsed_args.hostname.strip()
|
||||
hostname = utils.convert_to_unicode(hostname)
|
||||
hostname = convert_to_unicode(hostname)
|
||||
|
||||
inventory = Inventory.load()
|
||||
inventory.add_host(hostname)
|
||||
|
@ -129,7 +128,7 @@ class HostRemove(Command):
|
|||
def take_action(self, parsed_args):
|
||||
try:
|
||||
hostname = parsed_args.hostname.strip()
|
||||
hostname = utils.convert_to_unicode(hostname)
|
||||
hostname = convert_to_unicode(hostname)
|
||||
inventory = Inventory.load()
|
||||
inventory.remove_host(hostname)
|
||||
Inventory.save(inventory)
|
||||
|
@ -158,7 +157,7 @@ class HostList(Lister):
|
|||
hostname = None
|
||||
if parsed_args.hostname:
|
||||
hostname = parsed_args.hostname.strip()
|
||||
hostname = utils.convert_to_unicode(hostname)
|
||||
hostname = convert_to_unicode(hostname)
|
||||
|
||||
inventory = Inventory.load()
|
||||
|
||||
|
@ -197,7 +196,7 @@ class HostCheck(Command):
|
|||
def take_action(self, parsed_args):
|
||||
try:
|
||||
hostname = parsed_args.hostname.strip()
|
||||
hostname = utils.convert_to_unicode(hostname)
|
||||
hostname = convert_to_unicode(hostname)
|
||||
inventory = Inventory.load()
|
||||
if not inventory.get_host(hostname):
|
||||
_host_not_found(self.log, hostname)
|
||||
|
@ -241,7 +240,7 @@ class HostSetup(Command):
|
|||
else:
|
||||
# single host setup
|
||||
hostname = parsed_args.hostname.strip()
|
||||
hostname = utils.convert_to_unicode(hostname)
|
||||
hostname = convert_to_unicode(hostname)
|
||||
if not inventory.get_host(hostname):
|
||||
_host_not_found(self.log, hostname)
|
||||
|
||||
|
@ -257,7 +256,7 @@ class HostSetup(Command):
|
|||
setup_user = get_setup_user()
|
||||
password = getpass.getpass('%s password for %s: ' %
|
||||
(setup_user, hostname))
|
||||
password = utils.convert_to_unicode(password)
|
||||
password = convert_to_unicode(password)
|
||||
inventory.setup_host(hostname, password)
|
||||
|
||||
except CommandError as e:
|
||||
|
|
|
@ -5,7 +5,7 @@ cliff-tablib>=1.1
|
|||
docker-py>=1.3.1
|
||||
jsonpickle>=0.9
|
||||
oslo.i18n>=1.3.0 # Apache-2.0
|
||||
oslo.utils>-2.7.0
|
||||
oslo.utils!=2.6.0,>=2.4.0 # Apache-2.0
|
||||
paramiko>=1.15
|
||||
pbr>=0.10
|
||||
pexpect>=2.3,<3.3
|
||||
|
|
Loading…
Reference in New Issue