Removed package removal in stop hook

This commit is contained in:
Bilal Baqar 2016-03-26 20:07:37 +01:00
parent f7ff2f8dad
commit 382c0c71fa
3 changed files with 5 additions and 10 deletions

View File

@ -77,10 +77,8 @@ def plumgrid_joined(relation_id=None):
This hook is run when relation with edge or gateway is created. This hook is run when relation with edge or gateway is created.
''' '''
opsvm_ip = config('opsvm-ip') opsvm_ip = config('opsvm-ip')
if opsvm_ip == '127.0.0.1': if not is_ip(opsvm_ip):
pass raise ValueError('Incorrect OPSVM IP specified')
elif not is_ip(opsvm_ip):
raise ValueError('Incorrect IP specified')
else: else:
relation_set(relation_id=relation_id, opsvm_ip=opsvm_ip) relation_set(relation_id=relation_id, opsvm_ip=opsvm_ip)
@ -137,7 +135,7 @@ def start():
while (count < 10): while (count < 10):
if post_pg_license(): if post_pg_license():
break break
count = count + 1 count += 1
time.sleep(15) time.sleep(15)

View File

@ -412,10 +412,7 @@ def get_cidr_from_iface(interface):
def director_cluster_ready(): def director_cluster_ready():
dirs_count = len(pg_dir_context._pg_dir_ips()) dirs_count = len(pg_dir_context._pg_dir_ips())
log('DIR COUNT: %s' % dirs_count) log('DIR COUNT: %s' % dirs_count)
if dirs_count == 2: return True if dirs_count == 2 else False
return True
else:
return False
def restart_on_change(restart_map): def restart_on_change(restart_map):

View File

@ -60,7 +60,7 @@ class PGDirContextTest(CharmTestCase):
return "neutron.randomconfig" return "neutron.randomconfig"
config = {'plumgrid-virtual-ip': "192.168.100.250", config = {'plumgrid-virtual-ip': "192.168.100.250",
'opsvm-ip':'127.0.0.1'} 'opsvm-ip': '127.0.0.1'}
def mock_config(key=None): def mock_config(key=None):
if key: if key: