From 4c428ad08c298a35457ee957d4616c512fbfb8a7 Mon Sep 17 00:00:00 2001 From: John Dewey Date: Mon, 12 Aug 2013 17:49:21 -0700 Subject: [PATCH] Bug fix pyparsing upgrade for python quantum client The python-quantumclient package may not include the correct version of pyparsing in its dependencies, requiring us to ensure that it is upgraded to the latest version prior to usage. Needed to correct tests to pass openstack-common 0.4.0 changes. Change-Id: Ia8507a5fe94322ff3106d12d161dcedf2ee19fdd --- Berksfile.lock | 6 +++--- attributes/default.rb | 2 +- metadata.rb | 1 - recipes/common.rb | 11 +---------- spec/common_spec.rb | 19 +++++++++++++++++++ spec/identity_registration_spec.rb | 16 ++++++++-------- spec/metadata_agent_spec.rb | 2 +- 7 files changed, 33 insertions(+), 24 deletions(-) create mode 100644 spec/common_spec.rb diff --git a/Berksfile.lock b/Berksfile.lock index 19d9eba7..773cd831 100644 --- a/Berksfile.lock +++ b/Berksfile.lock @@ -6,12 +6,12 @@ "openstack-identity": { "locked_version": "7.0.0", "git": "https://github.com/stackforge/cookbook-openstack-identity.git", - "ref": "54e05e5f2e6f57934310c10d418ab263a9eb14bf" + "ref": "b881af26095cfa869a6970067c49597a0ee63586" }, "openstack-common": { - "locked_version": "0.3.5", + "locked_version": "0.4.3", "git": "https://github.com/stackforge/cookbook-openstack-common.git", - "ref": "4af229d56319b44945fe9e8ebd2ab2aa87b29c83" + "ref": "eb5eed7126b6a6efbaf803e8a594d610cf661e97" }, "database": { "locked_version": "1.4.0" diff --git a/attributes/default.rb b/attributes/default.rb index 14979839..982b4a21 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -720,7 +720,7 @@ when "ubuntu" "nova_network_packages" => [ "nova-network" ], "quantum_lb_packages" => ["quantum-lbaas-agent", "haproxy"], "quantum_packages" => [ "quantum-common", "python-pyparsing", "python-cliff" ], - "quantum_client_packages" => [ "python-quantumclient" ], + "quantum_client_packages" => [ "python-quantumclient", "python-pyparsing" ], "quantum_dhcp_packages" => [ "quantum-dhcp-agent" ], "quantum_dhcp_build_packages" => [ "build-essential", "pkg-config", "libidn11-dev", "libdbus-1-dev", "libnetfilter-conntrack-dev", "gettext" ], "quantum_l3_packages" => [ "quantum-l3-agent" ], diff --git a/metadata.rb b/metadata.rb index e567db97..2cd3ab58 100644 --- a/metadata.rb +++ b/metadata.rb @@ -17,4 +17,3 @@ depends "openstack-identity", "~> 7.0" depends "openstack-common", "~> 0.4.0" depends "mysql" depends "postgresql" -depends "python" diff --git a/recipes/common.rb b/recipes/common.rb index 07b670d9..df636572 100644 --- a/recipes/common.rb +++ b/recipes/common.rb @@ -127,21 +127,12 @@ else local_ip = address_for node["openstack"]["network"]["openvswitch"]["local_ip_interface"] end -# https://bugs.launchpad.net/neutron/+bug/1111572 platform_options["quantum_client_packages"].each do |pkg| package pkg do - action :install + action :upgrade options platform_options["package_overrides"] - notifies :upgrade, "python_pip[python-quantumclient]", :immediately end end -if platform?("ubuntu", "debian") - include_recipe "python::pip" -end -python_pip "python-quantumclient" do - action :nothing - only_if { platform?("ubuntu", "debian") } -end # all recipes include common.rb, and some servers # may just be running a subset of agents (like l3_agent) diff --git a/spec/common_spec.rb b/spec/common_spec.rb new file mode 100644 index 00000000..3190d976 --- /dev/null +++ b/spec/common_spec.rb @@ -0,0 +1,19 @@ +require_relative 'spec_helper' + +describe "openstack-network::common" do + describe "ubuntu" do + before do + quantum_stubs + @chef_run = ::ChefSpec::ChefRunner.new ::UBUNTU_OPTS + @chef_run.converge "openstack-network::common" + end + + it "upgrades python quantumclient" do + expect(@chef_run).to upgrade_package "python-quantumclient" + end + + it "upgrades python pyparsing" do + expect(@chef_run).to upgrade_package "python-pyparsing" + end + end +end diff --git a/spec/identity_registration_spec.rb b/spec/identity_registration_spec.rb index c27da76a..920a370a 100644 --- a/spec/identity_registration_spec.rb +++ b/spec/identity_registration_spec.rb @@ -14,7 +14,7 @@ describe "openstack-network::identity_registration" do ).to_hash expect(resource).to include( - :auth_uri => "https://127.0.0.1:35357/v2.0", + :auth_uri => "http://127.0.0.1:35357/v2.0", :bootstrap_token => "bootstrap-token", :service_type => "network", :service_description => "OpenStack Network Service", @@ -29,13 +29,13 @@ describe "openstack-network::identity_registration" do ).to_hash expect(resource).to include( - :auth_uri => "https://127.0.0.1:35357/v2.0", + :auth_uri => "http://127.0.0.1:35357/v2.0", :bootstrap_token => "bootstrap-token", :service_type => "network", :endpoint_region => "RegionOne", - :endpoint_adminurl => "https://127.0.0.1:9696", - :endpoint_internalurl => "https://127.0.0.1:9696", - :endpoint_publicurl => "https://127.0.0.1:9696", + :endpoint_adminurl => "http://127.0.0.1:9696", + :endpoint_internalurl => "http://127.0.0.1:9696", + :endpoint_publicurl => "http://127.0.0.1:9696", :action => [:create_endpoint] ) end @@ -47,7 +47,7 @@ describe "openstack-network::identity_registration" do ).to_hash expect(resource).to include( - :auth_uri => "https://127.0.0.1:35357/v2.0", + :auth_uri => "http://127.0.0.1:35357/v2.0", :bootstrap_token => "bootstrap-token", :tenant_name => "service", :tenant_description => "Service Tenant", @@ -62,7 +62,7 @@ describe "openstack-network::identity_registration" do ).to_hash expect(resource).to include( - :auth_uri => "https://127.0.0.1:35357/v2.0", + :auth_uri => "http://127.0.0.1:35357/v2.0", :bootstrap_token => "bootstrap-token", :tenant_name => "service", :user_name => "quantum", @@ -78,7 +78,7 @@ describe "openstack-network::identity_registration" do ).to_hash expect(resource).to include( - :auth_uri => "https://127.0.0.1:35357/v2.0", + :auth_uri => "http://127.0.0.1:35357/v2.0", :bootstrap_token => "bootstrap-token", :tenant_name => "service", :role_name => "admin", diff --git a/spec/metadata_agent_spec.rb b/spec/metadata_agent_spec.rb index b191830f..2c08975d 100644 --- a/spec/metadata_agent_spec.rb +++ b/spec/metadata_agent_spec.rb @@ -30,7 +30,7 @@ describe 'openstack-network::metadata_agent' do it "sets auth url correctly" do expect(@chef_run).to create_file_with_content @file.name, - "auth_url = https://127.0.0.1:5000/v2.0" + "auth_url = http://127.0.0.1:5000/v2.0" end it "sets auth region correctly" do expect(@chef_run).to create_file_with_content @file.name,