From 251f06e24f36910c0091989a1b2c056173ff1d97 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 6 Dec 2012 10:22:24 +0000 Subject: [PATCH] Updates post review including better backwards compatibility with 12.04 --- .project | 2 +- .pydevproject | 2 +- README.md | 4 +--- config.yaml | 10 ++-------- hooks/utils.py | 15 +++++++++------ revision | 2 +- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.project b/.project index 528f4924..809dae81 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - quantum + quantum-gateway diff --git a/.pydevproject b/.pydevproject index 6ab714cf..fcb67f1d 100644 --- a/.pydevproject +++ b/.pydevproject @@ -5,6 +5,6 @@ python 2.7 Default -/quantum/hooks +/quantum-gateway/hooks diff --git a/README.md b/README.md index 6ccd47cb..c793e183 100644 --- a/README.md +++ b/README.md @@ -28,15 +28,13 @@ In order to use Quantum with Openstack, you will need to deploy the nova-compute and nova-cloud-controller charms with the network-manager configuration set to 'Quantum': - nova-compute: - network-manager: Quantum nova-cloud-controller: network-manager: Quantum This decision must be made prior to deploying Openstack with Juju as Quantum is deployed baked into these charms from install onwards: - juju deploy --config config.yaml nova-compute + juju deploy nova-compute juju deploy --config config.yaml nova-cloud-controller juju add-relation nova-compute nova-cloud-controller diff --git a/config.yaml b/config.yaml index 2183722b..9aefa08d 100644 --- a/config.yaml +++ b/config.yaml @@ -3,9 +3,8 @@ options: default: ovs type: string description: | - Network configuration plugin to use to manage - the quantum network across quantum and nova-compute - nodes. Supported values include: + Network configuration plugin to use for quantum. + Supported values include: . ovs - OpenVSwitch ext-port: @@ -13,11 +12,6 @@ options: description: | External port to use for routing of instance traffic to the external public network. - region: - type: string - default: RegionOne - description: | - OpenStack region that this quantum service supports. openstack-origin: type: string description: | diff --git a/hooks/utils.py b/hooks/utils.py index 5ccf6b2d..8d84432b 100644 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -17,10 +17,12 @@ def do_hooks(hooks): hook = os.path.basename(sys.argv[0]) try: - hooks[hook]() + hook_func = hooks[hook] except KeyError: juju_log('INFO', "This charm doesn't know how to handle '{}'.".format(hook)) + else: + hook_func() def install(*pkgs): @@ -43,11 +45,9 @@ except ImportError: try: import dns.resolver - import dns.ipv4 except ImportError: install('python-dnspython') import dns.resolver - import dns.ipv4 def render_template(template_name, context, template_dir=TEMPLATES_DIR): @@ -65,7 +65,10 @@ deb http://ubuntu-cloud.archive.canonical.com/ubuntu {} main CLOUD_ARCHIVE_POCKETS = { 'folsom': 'precise-updates/folsom', 'folsom/updates': 'precise-updates/folsom', - 'folsom/proposed': 'precise-proposed/folsom' + 'folsom/proposed': 'precise-proposed/folsom', + 'grizzly': 'precise-updates/grizzly', + 'grizzly/updates': 'precise-updates/grizzly', + 'grizzly/proposed': 'precise-proposed/grizzly' } @@ -206,9 +209,9 @@ def get_unit_hostname(): def get_host_ip(hostname=unit_get('private-address')): try: # Test to see if already an IPv4 address - dns.ipv4.inet_aton(hostname) + socket.inet_aton(hostname) return hostname - except dns.exception.SyntaxError: + except socket.error: pass try: answers = dns.resolver.query(hostname, 'A') diff --git a/revision b/revision index bb95160c..a7873645 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -33 +34