Configuring analyst for OPSVM
Ticket: [SOL-1144] Signed-off-by: plumgrid <Junaid Ali>
This commit is contained in:
parent
cc4d437f24
commit
420e95c089
@ -41,7 +41,8 @@ from pg_dir_utils import (
|
||||
load_iptables,
|
||||
restart_on_change,
|
||||
director_cluster_ready,
|
||||
configure_pg_sources
|
||||
configure_pg_sources,
|
||||
configure_analyst_opsvm
|
||||
)
|
||||
|
||||
hooks = Hooks()
|
||||
@ -159,6 +160,7 @@ def start():
|
||||
'''
|
||||
This hook is run when the charm is started.
|
||||
'''
|
||||
configure_analyst_opsvm()
|
||||
if config('plumgrid-license-key') is not None:
|
||||
count = 0
|
||||
while (count < 10):
|
||||
|
@ -103,6 +103,31 @@ def configure_pg_sources():
|
||||
log('Unable to update /etc/apt/sources.list')
|
||||
|
||||
|
||||
def configure_analyst_opsvm():
|
||||
'''
|
||||
Configures Anaylyst for OPSVM
|
||||
'''
|
||||
if not service_running('plumgrid'):
|
||||
restart_pg()
|
||||
NS_ENTER = ('/opt/local/bin/nsenter -t $(ps ho pid --ppid '
|
||||
'$(cat /var/run/libvirt/lxc/plumgrid.pid)) -m -n -u -i -p ')
|
||||
sigmund_stop = NS_ENTER + '/usr/bin/service plumgrid-sigmund stop'
|
||||
sigmund_status = NS_ENTER \
|
||||
+ '/usr/bin/service plumgrid-sigmund status'
|
||||
sigmund_autoboot = NS_ENTER \
|
||||
+ '/usr/bin/sigmund-configure --ip {0} --start --autoboot' \
|
||||
.format(config('opsvm-ip'))
|
||||
try:
|
||||
status = subprocess.check_output(sigmund_status, shell=True)
|
||||
if 'start/running' in status:
|
||||
if subprocess.call(sigmund_stop, shell=True):
|
||||
log('plumgrid-sigmund couldn\'t be stopped!')
|
||||
return
|
||||
subprocess.check_call(sigmund_autoboot, shell=True)
|
||||
except:
|
||||
log('plumgrid-sigmund couldn\'t be started!')
|
||||
|
||||
|
||||
def determine_packages():
|
||||
'''
|
||||
Returns list of packages required by PLUMgrid director as specified
|
||||
|
@ -32,7 +32,8 @@ TO_PATCH = [
|
||||
'post_pg_license',
|
||||
'config',
|
||||
'load_iptables',
|
||||
'status_set'
|
||||
'status_set',
|
||||
'configure_analyst_opsvm'
|
||||
]
|
||||
NEUTRON_CONF_DIR = "/etc/neutron"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user