Resync charm-helpers

Change-Id: Ibbfcc6d2f0086ee9baf347ccfdf0344ed9c0fb82
This commit is contained in:
James Page 2016-03-02 10:58:54 +00:00
parent 3d885c2543
commit d938364366
3 changed files with 17 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
.testrepository
bin
*.sw[nop]
*.pyc

View File

@ -456,3 +456,18 @@ def get_hostname(address, fqdn=True):
return result
else:
return result.split('.')[0]
def port_has_listener(address, port):
"""
Returns True if the address:port is open and being listened to,
else False.
@param address: an IP address or hostname
@param port: integer port
Note calls 'zc' via a subprocess shell
"""
cmd = ['nc', '-z', address, str(port)]
result = subprocess.call(cmd)
return not(bool(result))

View File

@ -121,7 +121,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
# Charms which should use the source config option
use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
'ceph-osd', 'ceph-radosgw']
'ceph-osd', 'ceph-radosgw', 'ceph-mon']
# Charms which can not use openstack-origin, ie. many subordinates
no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',