Configuring analyst for OPSVM
Ticket: [SOL-1144] Signed-off-by: Junaid Ali <junaidali@plumgrid.com>
This commit is contained in:
parent
2f0a6900c9
commit
77a25e2225
@ -35,7 +35,8 @@ from pg_gw_utils import (
|
|||||||
restart_on_change,
|
restart_on_change,
|
||||||
restart_on_stop,
|
restart_on_stop,
|
||||||
director_cluster_ready,
|
director_cluster_ready,
|
||||||
configure_pg_sources
|
configure_pg_sources,
|
||||||
|
configure_analyst_opsvm
|
||||||
)
|
)
|
||||||
|
|
||||||
hooks = Hooks()
|
hooks = Hooks()
|
||||||
@ -69,6 +70,7 @@ def plumgrid_changed():
|
|||||||
'''
|
'''
|
||||||
if director_cluster_ready():
|
if director_cluster_ready():
|
||||||
ensure_mtu()
|
ensure_mtu()
|
||||||
|
configure_analyst_opsvm()
|
||||||
CONFIGS.write_all()
|
CONFIGS.write_all()
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,6 +93,32 @@ def configure_pg_sources():
|
|||||||
log('Unable to update /etc/apt/sources.list')
|
log('Unable to update /etc/apt/sources.list')
|
||||||
|
|
||||||
|
|
||||||
|
def configure_analyst_opsvm():
|
||||||
|
'''
|
||||||
|
Configures Anaylyst for OPSVM
|
||||||
|
'''
|
||||||
|
opsvm_ip = pg_gw_context._pg_dir_context()['opsvm_ip']
|
||||||
|
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(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():
|
def determine_packages():
|
||||||
'''
|
'''
|
||||||
Returns list of packages required by PLUMgrid Gateway as specified
|
Returns list of packages required by PLUMgrid Gateway as specified
|
||||||
|
@ -30,7 +30,8 @@ TO_PATCH = [
|
|||||||
'determine_packages',
|
'determine_packages',
|
||||||
'load_iptables',
|
'load_iptables',
|
||||||
'director_cluster_ready',
|
'director_cluster_ready',
|
||||||
'status_set'
|
'status_set',
|
||||||
|
'configure_analyst_opsvm'
|
||||||
]
|
]
|
||||||
NEUTRON_CONF_DIR = "/etc/neutron"
|
NEUTRON_CONF_DIR = "/etc/neutron"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user