More fixes.
This commit is contained in:
@@ -11,7 +11,7 @@ import sys
|
||||
import time
|
||||
import os
|
||||
|
||||
import maas
|
||||
import maas as MAAS
|
||||
import utils
|
||||
import pcmk
|
||||
|
||||
@@ -304,7 +304,7 @@ def configure_cluster():
|
||||
if None in [url, creds]:
|
||||
utils.juju_log('ERROR', 'maas_url and maas_credentials must be set'\
|
||||
' in config to enable STONITH.')
|
||||
maas = maas.MAASHelper(url, creds)
|
||||
maas = MAAS.MAASHelper(url, creds)
|
||||
nodes = maas.list_nodes()
|
||||
if not nodes:
|
||||
utils.juju_log('ERROR', 'Could not obtain node inventory from '\
|
||||
|
||||
@@ -10,7 +10,7 @@ MAAS_STABLE_PPA = 'ppa:maas-maintainers/stable '
|
||||
MAAS_PROFILE_NAME = 'maas-juju-hacluster'
|
||||
|
||||
class MAASHelper(object):
|
||||
def __init__(url, creds):
|
||||
def __init__(self, url, creds):
|
||||
self.url = url
|
||||
self.creds = creds
|
||||
self.install_maas_cli()
|
||||
@@ -30,7 +30,7 @@ class MAASHelper(object):
|
||||
subprocess.check_call(cmd)
|
||||
cmd = ['apt-get', 'update']
|
||||
subprocess.check_call(cmd)
|
||||
install_maas_cli()
|
||||
self.install_maas_cli()
|
||||
return
|
||||
|
||||
if not pkg.current_ver:
|
||||
@@ -42,7 +42,7 @@ class MAASHelper(object):
|
||||
try:
|
||||
subprocess.check_call(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
utils.juju_log('ERROR', 'Could not login to MAAS @ %s.' % url)
|
||||
utils.juju_log('ERROR', 'Could not login to MAAS @ %s.' % self.url)
|
||||
return False
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class MAASHelper(object):
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
|
||||
def list_nodes():
|
||||
def list_nodes(self):
|
||||
self.login()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user