Initial common Pike updates
- Bumped chefdk to 1.6.1 - Switched release to pike - Added is_release attribute for testing, defaults to false - Added RDO deps repo for testing pre-release packages - Added ubuntu-cloud proposed repo for testing pre-release packages - Switched the default linter to cookstyle - Normalized the banner message - Dropped pip installation method for python-openstackclient since the packages are fresh enough Change-Id: I7a67ba2520b8e44efec6edd8506f96b0e0dc913b
This commit is contained in:
		
							
								
								
									
										14
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Rakefile
									
									
									
									
									
								
							| @@ -1,20 +1,20 @@ | |||||||
| task default: ["test"] | task default: ["test"] | ||||||
|  |  | ||||||
| task :test => [:lint, :style, :unit] | task :test => [:syntax, :lint, :unit] | ||||||
|  |  | ||||||
| desc "Vendor the cookbooks in the Berksfile" | desc "Vendor the cookbooks in the Berksfile" | ||||||
| task :berks_prep do | task :berks_prep do | ||||||
|   sh %{chef exec berks vendor} |   sh %{chef exec berks vendor} | ||||||
| end | end | ||||||
|  |  | ||||||
| desc "Run FoodCritic (lint) tests" | desc "Run FoodCritic (syntax) tests" | ||||||
| task :lint do | task :syntax do | ||||||
|   sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .} |   sh %{chef exec foodcritic --exclude spec -f any .} | ||||||
| end | end | ||||||
|  |  | ||||||
| desc "Run RuboCop (style) tests" | desc "Run RuboCop (lint) tests" | ||||||
| task :style do | task :lint do | ||||||
|   sh %{chef exec rubocop} |   sh %{chef exec cookstyle} | ||||||
| end | end | ||||||
|  |  | ||||||
| desc "Run RSpec (unit) tests" | desc "Run RSpec (unit) tests" | ||||||
|   | |||||||
| @@ -101,7 +101,7 @@ default['openstack']['db']['charset'] = { | |||||||
|   pgsql: nil, |   pgsql: nil, | ||||||
|   sqlite: nil, |   sqlite: nil, | ||||||
|   nosql: nil, |   nosql: nil, | ||||||
|   galera: 'utf8' |   galera: 'utf8', | ||||||
| } | } | ||||||
|  |  | ||||||
| # Database connection options. Should include starting '?' | # Database connection options. Should include starting '?' | ||||||
| @@ -112,13 +112,13 @@ default['openstack']['db']['options'] = { | |||||||
|   postgresql: '', |   postgresql: '', | ||||||
|   sqlite: '', |   sqlite: '', | ||||||
|   nosql: '', |   nosql: '', | ||||||
|   galera: "?charset=#{node['openstack']['db']['charset']['galera']}" |   galera: "?charset=#{node['openstack']['db']['charset']['galera']}", | ||||||
| } | } | ||||||
|  |  | ||||||
| # platform and DBMS-specific python client packages | # platform and DBMS-specific python client packages | ||||||
| default['openstack']['db']['python_packages'] = { | default['openstack']['db']['python_packages'] = { | ||||||
|   postgresql: ['python-psycopg2'], |   postgresql: ['python-psycopg2'], | ||||||
|   sqlite: [] |   sqlite: [], | ||||||
| } | } | ||||||
| case node['platform_family'] | case node['platform_family'] | ||||||
| when 'rhel' | when 'rhel' | ||||||
|   | |||||||
| @@ -19,16 +19,17 @@ | |||||||
| # limitations under the License. | # limitations under the License. | ||||||
| # | # | ||||||
|  |  | ||||||
|  | # Release mode toggle for testing frameworks. Defaults to false. | ||||||
|  | # Override this to true at the environment level when you're ready. | ||||||
|  | default['openstack']['is_release'] = false | ||||||
|  |  | ||||||
| # Set to some text value if you want templated config files | # Set to some text value if you want templated config files | ||||||
| # to contain a custom banner at the top of the written file | # to contain a custom banner at the top of the written file | ||||||
| default['openstack']['common']['custom_template_banner'] = ' | default['openstack']['common']['custom_template_banner'] = ' | ||||||
| # This file autogenerated by Chef | # This file is automatically generated by Chef | ||||||
| # Do not edit, changes will be overwritten | # Any changes will be overwritten | ||||||
| ' | ' | ||||||
|  |  | ||||||
| # version for python-openstackclient |  | ||||||
| default['openstack']['common']['client_version'] = '3.11.0' |  | ||||||
|  |  | ||||||
| # OpenStack services and their project names | # OpenStack services and their project names | ||||||
| default['openstack']['common']['services'] = { | default['openstack']['common']['services'] = { | ||||||
|   'bare-metal' => 'ironic', |   'bare-metal' => 'ironic', | ||||||
| @@ -45,7 +46,7 @@ default['openstack']['common']['services'] = { | |||||||
|   'orchestration' => 'heat', |   'orchestration' => 'heat', | ||||||
|   'telemetry' => 'ceilometer', |   'telemetry' => 'ceilometer', | ||||||
|   'telemetry-metric' => 'gnocchi', |   'telemetry-metric' => 'gnocchi', | ||||||
|   'application-catalog' => 'murano' |   'application-catalog' => 'murano', | ||||||
| } | } | ||||||
|  |  | ||||||
| # Setting this to True means that database passwords and service user | # Setting this to True means that database passwords and service user | ||||||
| @@ -119,7 +120,7 @@ default['openstack']['secret']['user_passwords_data_bag'] = 'user_passwords' | |||||||
| # needs. | # needs. | ||||||
|  |  | ||||||
| # The coordinated release of OpenStack codename | # The coordinated release of OpenStack codename | ||||||
| default['openstack']['release'] = 'ocata' | default['openstack']['release'] = 'pike' | ||||||
|  |  | ||||||
| # The Ubuntu Cloud Archive has packages for multiple Ubuntu releases. For | # The Ubuntu Cloud Archive has packages for multiple Ubuntu releases. For | ||||||
| # more information, see: https://wiki.ubuntu.com/ServerTeam/CloudArchive. | # more information, see: https://wiki.ubuntu.com/ServerTeam/CloudArchive. | ||||||
| @@ -153,52 +154,52 @@ default['openstack']['api']['auth']['version'] = 'v3.0' | |||||||
| default['openstack']['logging']['loggers'] = { | default['openstack']['logging']['loggers'] = { | ||||||
|   'root' => { |   'root' => { | ||||||
|     'level' => 'NOTSET', |     'level' => 'NOTSET', | ||||||
|     'handlers' => 'devel' |     'handlers' => 'devel', | ||||||
|   }, |   }, | ||||||
|   'ceilometer' => { |   'ceilometer' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'ceilometer' |     'qualname' => 'ceilometer', | ||||||
|   }, |   }, | ||||||
|   'cinder' => { |   'cinder' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'cinder' |     'qualname' => 'cinder', | ||||||
|   }, |   }, | ||||||
|   'glance' => { |   'glance' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'glance' |     'qualname' => 'glance', | ||||||
|   }, |   }, | ||||||
|   'horizon' => { |   'horizon' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'horizon' |     'qualname' => 'horizon', | ||||||
|   }, |   }, | ||||||
|   'keystone' => { |   'keystone' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'keystone' |     'qualname' => 'keystone', | ||||||
|   }, |   }, | ||||||
|   'nova' => { |   'nova' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'nova' |     'qualname' => 'nova', | ||||||
|   }, |   }, | ||||||
|   'neutron' => { |   'neutron' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'neutron' |     'qualname' => 'neutron', | ||||||
|   }, |   }, | ||||||
|   'trove' => { |   'trove' => { | ||||||
|     'level' => 'DEBUG', |     'level' => 'DEBUG', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'trove' |     'qualname' => 'trove', | ||||||
|   }, |   }, | ||||||
|   'amqplib' => { |   'amqplib' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
|     'handlers' => 'stderr', |     'handlers' => 'stderr', | ||||||
|     'qualname' => 'amqplib' |     'qualname' => 'amqplib', | ||||||
|   }, |   }, | ||||||
|   'sqlalchemy' => { |   'sqlalchemy' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
| @@ -206,52 +207,52 @@ default['openstack']['logging']['loggers'] = { | |||||||
|     # "level' => 'DEBUG" logs SQL queries and results. |     # "level' => 'DEBUG" logs SQL queries and results. | ||||||
|     # "level' => 'WARNING" logs neither.  (Recommended for production systems.) |     # "level' => 'WARNING" logs neither.  (Recommended for production systems.) | ||||||
|     'handlers' => 'stderr', |     'handlers' => 'stderr', | ||||||
|     'qualname' => 'sqlalchemy' |     'qualname' => 'sqlalchemy', | ||||||
|   }, |   }, | ||||||
|   'boto' => { |   'boto' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
|     'handlers' => 'stderr', |     'handlers' => 'stderr', | ||||||
|     'qualname' => 'boto' |     'qualname' => 'boto', | ||||||
|   }, |   }, | ||||||
|   'suds' => { |   'suds' => { | ||||||
|     'level' => 'INFO', |     'level' => 'INFO', | ||||||
|     'handlers' => 'stderr', |     'handlers' => 'stderr', | ||||||
|     'qualname' => 'suds' |     'qualname' => 'suds', | ||||||
|   }, |   }, | ||||||
|   'eventletwsgi' => { |   'eventletwsgi' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
|     'handlers' => 'stderr', |     'handlers' => 'stderr', | ||||||
|     'qualname' => 'eventlet.wsgi.server' |     'qualname' => 'eventlet.wsgi.server', | ||||||
|   }, |   }, | ||||||
|   'nova_api_openstack_wsgi' => { |   'nova_api_openstack_wsgi' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'nova.api.openstack.wsgi' |     'qualname' => 'nova.api.openstack.wsgi', | ||||||
|   }, |   }, | ||||||
|   'nova_osapi_compute_wsgi_server' => { |   'nova_osapi_compute_wsgi_server' => { | ||||||
|     'level' => 'WARNING', |     'level' => 'WARNING', | ||||||
|     'handlers' => 'prod,debug', |     'handlers' => 'prod,debug', | ||||||
|     'qualname' => 'nova.osapi_compute.wsgi.server' |     'qualname' => 'nova.osapi_compute.wsgi.server', | ||||||
|   } |   }, | ||||||
| } | } | ||||||
|  |  | ||||||
| # Allow configured formatters in logging.conf | # Allow configured formatters in logging.conf | ||||||
| default['openstack']['logging']['formatters'] = { | default['openstack']['logging']['formatters'] = { | ||||||
|   'normal' => { |   'normal' => { | ||||||
|     'format' => '%(asctime)s %(levelname)s %(message)s' |     'format' => '%(asctime)s %(levelname)s %(message)s', | ||||||
|   }, |   }, | ||||||
|   'normal_with_name' => { |   'normal_with_name' => { | ||||||
|     'format' => '[%(name)s]: %(asctime)s %(levelname)s %(message)s' |     'format' => '[%(name)s]: %(asctime)s %(levelname)s %(message)s', | ||||||
|   }, |   }, | ||||||
|   'debug' => { |   'debug' => { | ||||||
|     'format' => '[%(name)s]: %(asctime)s %(levelname)s %(module)s.%(funcName)s %(message)s' |     'format' => '[%(name)s]: %(asctime)s %(levelname)s %(module)s.%(funcName)s %(message)s', | ||||||
|   }, |   }, | ||||||
|   'syslog_with_name' => { |   'syslog_with_name' => { | ||||||
|     'format' => '%(name)s: %(levelname)s %(message)s' |     'format' => '%(name)s: %(levelname)s %(message)s', | ||||||
|   }, |   }, | ||||||
|   'syslog_debug' => { |   'syslog_debug' => { | ||||||
|     'format' => '%(name)s: %(levelname)s %(module)s.%(funcName)s %(message)s' |     'format' => '%(name)s: %(levelname)s %(module)s.%(funcName)s %(message)s', | ||||||
|   } |   }, | ||||||
| } | } | ||||||
|  |  | ||||||
| # Allow configured logging handlers in logging.conf | # Allow configured logging handlers in logging.conf | ||||||
| @@ -259,26 +260,26 @@ default['openstack']['logging']['handlers'] = { | |||||||
|   'stderr' => { |   'stderr' => { | ||||||
|     'args' => '(sys.stderr,)', |     'args' => '(sys.stderr,)', | ||||||
|     'class' => 'StreamHandler', |     'class' => 'StreamHandler', | ||||||
|     'formatter' => 'debug' |     'formatter' => 'debug', | ||||||
|   }, |   }, | ||||||
|   'devel' => { |   'devel' => { | ||||||
|     'args' => '(sys.stdout,)', |     'args' => '(sys.stdout,)', | ||||||
|     'class' => 'StreamHandler', |     'class' => 'StreamHandler', | ||||||
|     'formatter' => 'debug', |     'formatter' => 'debug', | ||||||
|     'level' => 'NOTSET' |     'level' => 'NOTSET', | ||||||
|   }, |   }, | ||||||
|   'prod' => { |   'prod' => { | ||||||
|     'args' => '((\'/dev/log\'), handlers.SysLogHandler.LOG_LOCAL0)', |     'args' => '((\'/dev/log\'), handlers.SysLogHandler.LOG_LOCAL0)', | ||||||
|     'class' => 'handlers.SysLogHandler', |     'class' => 'handlers.SysLogHandler', | ||||||
|     'formatter' => 'syslog_with_name', |     'formatter' => 'syslog_with_name', | ||||||
|     'level' => 'INFO' |     'level' => 'INFO', | ||||||
|   }, |   }, | ||||||
|   'debug' => { |   'debug' => { | ||||||
|     'args' => '((\'/dev/log\'), handlers.SysLogHandler.LOG_LOCAL1)', |     'args' => '((\'/dev/log\'), handlers.SysLogHandler.LOG_LOCAL1)', | ||||||
|     'class' => 'handlers.SysLogHandler', |     'class' => 'handlers.SysLogHandler', | ||||||
|     'formatter' => 'syslog_debug', |     'formatter' => 'syslog_debug', | ||||||
|     'level' => 'DEBUG' |     'level' => 'DEBUG', | ||||||
|   } |   }, | ||||||
| } | } | ||||||
|  |  | ||||||
| default['openstack']['memcached_servers'] = nil | default['openstack']['memcached_servers'] = nil | ||||||
| @@ -290,11 +291,11 @@ default['openstack']['sysctl']['net.ipv4.conf.default.rp_filter'] = 0 | |||||||
| case node['platform_family'] | case node['platform_family'] | ||||||
| when 'rhel' | when 'rhel' | ||||||
|   default['openstack']['common']['platform'] = { |   default['openstack']['common']['platform'] = { | ||||||
|     'package_overrides' => '' |     'package_overrides' => '', | ||||||
|   } |   } | ||||||
| when 'debian' | when 'debian' | ||||||
|   default['openstack']['common']['platform'] = { |   default['openstack']['common']['platform'] = { | ||||||
|     'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'" |     'package_overrides' => "-o Dpkg::Options::='--force-confold' -o Dpkg::Options::='--force-confdef'", | ||||||
|   } |   } | ||||||
| end | end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -92,7 +92,7 @@ rabbit_defaults = { | |||||||
|   kombu_ssl_certfile: node['openstack']['mq']['rabbitmq']['kombu_ssl_certfile'], |   kombu_ssl_certfile: node['openstack']['mq']['rabbitmq']['kombu_ssl_certfile'], | ||||||
|   kombu_ssl_ca_certs: node['openstack']['mq']['rabbitmq']['kombu_ssl_ca_certs'], |   kombu_ssl_ca_certs: node['openstack']['mq']['rabbitmq']['kombu_ssl_ca_certs'], | ||||||
|   kombu_reconnect_delay: node['openstack']['mq']['rabbitmq']['kombu_reconnect_delay'], |   kombu_reconnect_delay: node['openstack']['mq']['rabbitmq']['kombu_reconnect_delay'], | ||||||
|   kombu_reconnect_timeout: node['openstack']['mq']['rabbitmq']['kombu_reconnect_timeout'] |   kombu_reconnect_timeout: node['openstack']['mq']['rabbitmq']['kombu_reconnect_timeout'], | ||||||
| } | } | ||||||
|  |  | ||||||
| ################################################################### | ################################################################### | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ if [ -f /usr/bin/yum ] ; then | |||||||
|   sudo pip uninstall requests -y || true |   sudo pip uninstall requests -y || true | ||||||
|  |  | ||||||
|   # install chefdk |   # install chefdk | ||||||
|   chefdk=chefdk-1.5.0-1.el7.x86_64.rpm |   chefdk=chefdk-1.6.1-1.el7.x86_64.rpm | ||||||
|   wget -nv -t 3 https://packages.chef.io/stable/el/7/$chefdk |   wget -nv -t 3 https://packages.chef.io/stable/el/7/$chefdk | ||||||
|   sudo yum -y install $chefdk |   sudo yum -y install $chefdk | ||||||
|   rm $chefdk |   rm $chefdk | ||||||
| @@ -26,7 +26,7 @@ elif [ -f /usr/bin/apt-get ]; then | |||||||
|   sudo apt-get -y install build-essential liblzma-dev zlib1g-dev |   sudo apt-get -y install build-essential liblzma-dev zlib1g-dev | ||||||
|  |  | ||||||
|   # install chefdk |   # install chefdk | ||||||
|   chefdk=chefdk_1.5.0-1_amd64.deb |   chefdk=chefdk_1.6.1-1_amd64.deb | ||||||
|   wget -nv -t 3 https://packages.chef.io/stable/ubuntu/16.04/$chefdk |   wget -nv -t 3 https://packages.chef.io/stable/ubuntu/16.04/$chefdk | ||||||
|   sudo dpkg -i $chefdk |   sudo dpkg -i $chefdk | ||||||
|   rm $chefdk |   rm $chefdk | ||||||
|   | |||||||
| @@ -41,7 +41,7 @@ module ::Openstack | |||||||
|       'OS_USER_DOMAIN_NAME' => user_domain, |       'OS_USER_DOMAIN_NAME' => user_domain, | ||||||
|       'OS_PROJECT_DOMAIN_NAME' => project_domain, |       'OS_PROJECT_DOMAIN_NAME' => project_domain, | ||||||
|       'OS_IDENTITY_API_VERSION' => '3', |       'OS_IDENTITY_API_VERSION' => '3', | ||||||
|       'OS_AUTH_URL' => auth_uri |       'OS_AUTH_URL' => auth_uri, | ||||||
|     } |     } | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -51,7 +51,7 @@ module ::Openstack | |||||||
|   end |   end | ||||||
|  |  | ||||||
|   # Shortcut to get the SQLAlchemy DB URI for a named service |   # Shortcut to get the SQLAlchemy DB URI for a named service | ||||||
|   def db_uri(service, user, pass, is_slave = false) # rubocop:disable MethodLength, CyclomaticComplexity |   def db_uri(service, user, pass, is_slave = false) | ||||||
|     info = db(service) |     info = db(service) | ||||||
|     return unless info |     return unless info | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,7 +46,6 @@ if defined?(ChefSpec) | |||||||
|       self |       self | ||||||
|     end |     end | ||||||
|  |  | ||||||
|     # rubocop:disable MethodLength, CyclomaticComplexity |  | ||||||
|     def matches_content? |     def matches_content? | ||||||
|       def section?(line, section = '.*') |       def section?(line, section = '.*') | ||||||
|         return true if line =~ /^[ \t]*\[#{section}\]/ |         return true if line =~ /^[ \t]*\[#{section}\]/ | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ module ::Openstack | |||||||
|   # into a single element array. |   # into a single element array. | ||||||
|   # table - the raw PrettyTable output of the CLI command |   # table - the raw PrettyTable output of the CLI command | ||||||
|   # output - array of hashes representing the data. |   # output - array of hashes representing the data. | ||||||
|   def prettytable_to_array(table) # rubocop:disable MethodLength |   def prettytable_to_array(table) | ||||||
|     ret = [] |     ret = [] | ||||||
|     return ret if table.nil? |     return ret if table.nil? | ||||||
|     indicies = [] |     indicies = [] | ||||||
|   | |||||||
| @@ -57,7 +57,7 @@ def connection_info | |||||||
|     port: @port.to_i, |     port: @port.to_i, | ||||||
|     username: @super_user, |     username: @super_user, | ||||||
|     password: @super_password, |     password: @super_password, | ||||||
|     socket: @socket |     socket: @socket, | ||||||
|   } |   } | ||||||
| end | end | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,17 +19,4 @@ | |||||||
| # limitations under the License. | # limitations under the License. | ||||||
| # | # | ||||||
|  |  | ||||||
| python_runtime '2' | package 'python-openstackclient' | ||||||
|  |  | ||||||
| python_virtualenv '/opt/osc' do |  | ||||||
|   system_site_packages true |  | ||||||
| end |  | ||||||
|  |  | ||||||
| python_package 'python-openstackclient' do |  | ||||||
|   version node['openstack']['common']['client_version'] |  | ||||||
|   virtualenv '/opt/osc' |  | ||||||
| end |  | ||||||
|  |  | ||||||
| link '/usr/local/bin/openstack' do |  | ||||||
|   to '/opt/osc/bin/openstack' |  | ||||||
| end |  | ||||||
|   | |||||||
| @@ -37,6 +37,20 @@ when 'debian' | |||||||
|       distribution "#{node['lsb']['codename']}-updates/#{node['openstack']['release']}" |       distribution "#{node['lsb']['codename']}-updates/#{node['openstack']['release']}" | ||||||
|       components apt_components |       components apt_components | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     # add in the proposed repo, but only if we're in development | ||||||
|  |     proposed_action = if node['openstack']['is_release'] | ||||||
|  |                         :remove | ||||||
|  |                       else | ||||||
|  |                         :add | ||||||
|  |                       end | ||||||
|  |  | ||||||
|  |     apt_repository 'openstack-ppa-proposed' do | ||||||
|  |       uri node['openstack']['apt']['uri'] | ||||||
|  |       distribution "#{node['lsb']['codename']}-proposed/#{node['openstack']['release']}" | ||||||
|  |       components apt_components | ||||||
|  |       action proposed_action | ||||||
|  |     end | ||||||
|   end |   end | ||||||
| when 'rhel' | when 'rhel' | ||||||
|   include_recipe 'yum' if node['openstack']['yum']['update_yum_cache'] |   include_recipe 'yum' if node['openstack']['yum']['update_yum_cache'] | ||||||
| @@ -58,6 +72,25 @@ when 'rhel' | |||||||
|     enabled true |     enabled true | ||||||
|     action repo_action |     action repo_action | ||||||
|   end |   end | ||||||
|  |  | ||||||
|  |   # add in the RDO deps, but only if we're in development | ||||||
|  |   deps_action = if node['openstack']['is_release'] | ||||||
|  |                   :remove | ||||||
|  |                 else | ||||||
|  |                   :add | ||||||
|  |                 end | ||||||
|  |  | ||||||
|  |   yum_repository "RDO-#{node['openstack']['release']}-deps" do | ||||||
|  |     description "OpenStack RDO deps repo for #{node['openstack']['release']}" | ||||||
|  |     baseurl "https://buildlogs.centos.org/centos/7/cloud/x86_64/openstack-#{node['openstack']['release']}" | ||||||
|  |     gpgcheck false | ||||||
|  |     enabled true | ||||||
|  |     action deps_action | ||||||
|  |   end | ||||||
|  |  | ||||||
|  |   package 'centos-release-qemu-ev' do | ||||||
|  |     action :upgrade | ||||||
|  |   end | ||||||
| end | end | ||||||
|  |  | ||||||
| if node['openstack']['databag_type'] == 'vault' | if node['openstack']['databag_type'] == 'vault' | ||||||
|   | |||||||
							
								
								
									
										32
									
								
								recipes/python.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								recipes/python.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | |||||||
|  | # encoding: UTF-8 | ||||||
|  | # | ||||||
|  | # Cookbook Name:: openstack-common | ||||||
|  | # recipe:: python | ||||||
|  | # | ||||||
|  | # Copyright 2017 Workday Inc. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | # | ||||||
|  |  | ||||||
|  | # install system packages for Ubuntu/Debian | ||||||
|  | case node['platform_family'] | ||||||
|  | when 'debian', 'ubuntu' | ||||||
|  |   python_runtime '3.5' do | ||||||
|  |     provider :system | ||||||
|  |   end | ||||||
|  | # use Software Collections for CentOS/RHEL | ||||||
|  | when 'rhel' | ||||||
|  |   python_runtime '3.5' do | ||||||
|  |     provider :scl | ||||||
|  |   end | ||||||
|  | end | ||||||
| @@ -19,7 +19,7 @@ describe 'openstack-common::default' do | |||||||
|           host: '127.0.0.1', |           host: '127.0.0.1', | ||||||
|           scheme: 'http', |           scheme: 'http', | ||||||
|           path: '/v3', |           path: '/v3', | ||||||
|           port: '35357' |           port: '35357', | ||||||
|         } |         } | ||||||
|       end |       end | ||||||
|       it 'returns cli enviroment' do |       it 'returns cli enviroment' do | ||||||
| @@ -51,7 +51,7 @@ describe 'openstack-common::default' do | |||||||
|             'OS_USER_DOMAIN_NAME' => 'default', |             'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|             'OS_PROJECT_DOMAIN_NAME' => 'default', |             'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|             'OS_IDENTITY_API_VERSION' => 3 |             'OS_IDENTITY_API_VERSION' => 3, | ||||||
|           } |           } | ||||||
|         allow(subject).to receive(:shell_out).with( |         allow(subject).to receive(:shell_out).with( | ||||||
|           %w(openstack user list), |           %w(openstack user list), | ||||||
| @@ -71,7 +71,7 @@ describe 'openstack-common::default' do | |||||||
|             'OS_USER_DOMAIN_NAME' => 'default', |             'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|             'OS_PROJECT_DOMAIN_NAME' => 'default', |             'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|             'OS_IDENTITY_API_VERSION' => 3 |             'OS_IDENTITY_API_VERSION' => 3, | ||||||
|           } |           } | ||||||
|         allow(subject).to receive(:shell_out).with( |         allow(subject).to receive(:shell_out).with( | ||||||
|           %w(openstack --key1 value1 --key2 value2 --key3 user list), |           %w(openstack --key1 value1 --key2 value2 --key3 user list), | ||||||
| @@ -91,7 +91,7 @@ describe 'openstack-common::default' do | |||||||
|             'OS_USER_DOMAIN_NAME' => 'default', |             'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|             'OS_PROJECT_DOMAIN_NAME' => 'default', |             'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|             'OS_IDENTITY_API_VERSION' => 3 |             'OS_IDENTITY_API_VERSION' => 3, | ||||||
|           } |           } | ||||||
|         allow(subject).to receive(:shell_out).with( |         allow(subject).to receive(:shell_out).with( | ||||||
|           %w(openstack user list), |           %w(openstack user list), | ||||||
| @@ -110,7 +110,7 @@ describe 'openstack-common::default' do | |||||||
|             'OS_USER_DOMAIN_NAME' => 'default', |             'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|             'OS_PROJECT_DOMAIN_NAME' => 'default', |             'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|             'OS_IDENTITY_API_VERSION' => 3 |             'OS_IDENTITY_API_VERSION' => 3, | ||||||
|           } |           } | ||||||
|         allow(subject).to receive(:openstack_command).with('openstack', 'user list', env, {}) |         allow(subject).to receive(:openstack_command).with('openstack', 'user list', env, {}) | ||||||
|         allow(subject).to receive(:prettytable_to_array) |         allow(subject).to receive(:prettytable_to_array) | ||||||
| @@ -130,7 +130,7 @@ describe 'openstack-common::default' do | |||||||
|           'OS_USER_DOMAIN_NAME' => 'default', |           'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|           'OS_PROJECT_DOMAIN_NAME' => 'default', |           'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|           'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |           'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|           'OS_IDENTITY_API_VERSION' => 3 |           'OS_IDENTITY_API_VERSION' => 3, | ||||||
|         } |         } | ||||||
|       end |       end | ||||||
|  |  | ||||||
| @@ -161,7 +161,7 @@ describe 'openstack-common::default' do | |||||||
|             'OS_USER_DOMAIN_NAME' => 'default', |             'OS_USER_DOMAIN_NAME' => 'default', | ||||||
|             'OS_PROJECT_DOMAIN_NAME' => 'default', |             'OS_PROJECT_DOMAIN_NAME' => 'default', | ||||||
|             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', |             'OS_AUTH_URL' => 'http://127.0.0.1:35357/v3', | ||||||
|             'OS_IDENTITY_API_VERSION' => 3 |             'OS_IDENTITY_API_VERSION' => 3, | ||||||
|           } |           } | ||||||
|         allow(subject).to receive(:openstack_command).with('openstack', 'network list', env, {}) |         allow(subject).to receive(:openstack_command).with('openstack', 'network list', env, {}) | ||||||
|         allow(subject).to receive(:prettytable_to_array) |         allow(subject).to receive(:prettytable_to_array) | ||||||
|   | |||||||
| @@ -10,22 +10,7 @@ describe 'openstack-common::client' do | |||||||
|     end |     end | ||||||
|  |  | ||||||
|     it do |     it do | ||||||
|       expect(chef_run).to install_python_runtime('2') |       expect(chef_run).to install_package('python-openstackclient') | ||||||
|     end |  | ||||||
|  |  | ||||||
|     it do |  | ||||||
|       expect(chef_run).to create_python_virtualenv('/opt/osc') |  | ||||||
|         .with(system_site_packages: true) |  | ||||||
|     end |  | ||||||
|  |  | ||||||
|     it do |  | ||||||
|       expect(chef_run).to install_python_package('python-openstackclient') |  | ||||||
|         .with(version: '3.11.0') |  | ||||||
|     end |  | ||||||
|  |  | ||||||
|     it do |  | ||||||
|       expect(chef_run).to create_link('/usr/local/bin/openstack') |  | ||||||
|         .with(to: '/opt/osc/bin/openstack') |  | ||||||
|     end |     end | ||||||
|   end |   end | ||||||
| end | end | ||||||
|   | |||||||
| @@ -19,15 +19,15 @@ describe 'openstack-common::default' do | |||||||
|           'another_section' => { 'foo' => 'bar', 'baz' => 'yay' }, |           'another_section' => { 'foo' => 'bar', 'baz' => 'yay' }, | ||||||
|           'deep_section' => { |           'deep_section' => { | ||||||
|             'foo' => { key: 'bar', value: 'baz' }, |             'foo' => { key: 'bar', value: 'baz' }, | ||||||
|             'baz' => 'yay' |             'baz' => 'yay', | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|       node.set['openstack']['anyservice']['conf_secrets'] = |       node.set['openstack']['anyservice']['conf_secrets'] = | ||||||
|         { |         { | ||||||
|           'Default' => { 'secret_log' => 'secret_file_to_log' }, |           'Default' => { 'secret_log' => 'secret_file_to_log' }, | ||||||
|           'secret_section' => { 'password' => '1234' }, |           'secret_section' => { 'password' => '1234' }, | ||||||
|           'another_section' => { 'secret_foo' => 'secret_bar' }, |           'another_section' => { 'secret_foo' => 'secret_bar' }, | ||||||
|           'another_secret_section' => { 'secret_baz' => 'secret_yay' } |           'another_secret_section' => { 'secret_baz' => 'secret_yay' }, | ||||||
|         } |         } | ||||||
|     end |     end | ||||||
|  |  | ||||||
| @@ -47,7 +47,7 @@ describe 'openstack-common::default' do | |||||||
|           'another_secret_section' => { 'secret_baz' => 'secret_yay' }, |           'another_secret_section' => { 'secret_baz' => 'secret_yay' }, | ||||||
|           'deep_section' => { |           'deep_section' => { | ||||||
|             'foo' => { 'key' => 'bar', 'value' => 'baz' }, |             'foo' => { 'key' => 'bar', 'value' => 'baz' }, | ||||||
|             'baz' => 'yay' |             'baz' => 'yay', | ||||||
|           } |           } | ||||||
|         ) |         ) | ||||||
|       end |       end | ||||||
|   | |||||||
| @@ -11,6 +11,10 @@ describe 'openstack-common::default' do | |||||||
|       runner.converge(described_recipe) |       runner.converge(described_recipe) | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     it do | ||||||
|  |       expect(chef_run).to upgrade_package('centos-release-qemu-ev') | ||||||
|  |     end | ||||||
|  |  | ||||||
|     context 'enabling RDO with gpgcheck enabled' do |     context 'enabling RDO with gpgcheck enabled' do | ||||||
|       before do |       before do | ||||||
|         node.set['openstack']['yum']['rdo_enabled'] = true |         node.set['openstack']['yum']['rdo_enabled'] = true | ||||||
| @@ -50,6 +54,16 @@ describe 'openstack-common::default' do | |||||||
|       end |       end | ||||||
|     end |     end | ||||||
|  |  | ||||||
|  |     context 'disabling RDO deps repo with is_release true' do | ||||||
|  |       before do | ||||||
|  |         node.set['openstack']['is_release'] = true | ||||||
|  |       end | ||||||
|  |  | ||||||
|  |       it 'does not add the RDO deps yum repository' do | ||||||
|  |         expect(chef_run).to_not add_yum_repository('RDO-testrelease-deps') | ||||||
|  |       end | ||||||
|  |     end | ||||||
|  |  | ||||||
|     context 'disabling RDO' do |     context 'disabling RDO' do | ||||||
|       before do |       before do | ||||||
|         node.set['openstack']['yum']['rdo_enabled'] = false |         node.set['openstack']['yum']['rdo_enabled'] = false | ||||||
|   | |||||||
| @@ -29,7 +29,7 @@ describe 'openstack-common::default' do | |||||||
|       node.set['openstack']['apt']['live_updates_enabled'] = true |       node.set['openstack']['apt']['live_updates_enabled'] = true | ||||||
|       expect(chef_run).to add_apt_repository('openstack-ppa').with( |       expect(chef_run).to add_apt_repository('openstack-ppa').with( | ||||||
|         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', |         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', | ||||||
|         distribution: 'xenial-updates/ocata', |         distribution: 'xenial-updates/pike', | ||||||
|         components: ['main'] |         components: ['main'] | ||||||
|       ) |       ) | ||||||
|     end |     end | ||||||
| @@ -38,7 +38,24 @@ describe 'openstack-common::default' do | |||||||
|       node.set['openstack']['apt']['live_updates_enabled'] = false |       node.set['openstack']['apt']['live_updates_enabled'] = false | ||||||
|       expect(chef_run).to_not add_apt_repository('openstack-ppa').with( |       expect(chef_run).to_not add_apt_repository('openstack-ppa').with( | ||||||
|         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', |         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', | ||||||
|         distribution: 'xenial-updates/ocata', |         distribution: 'xenial-updates/pike', | ||||||
|  |         components: ['main'] | ||||||
|  |       ) | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |     it 'configures openstack proposed repository' do | ||||||
|  |       expect(chef_run).to add_apt_repository('openstack-ppa-proposed').with( | ||||||
|  |         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', | ||||||
|  |         distribution: 'xenial-proposed/pike', | ||||||
|  |         components: ['main'] | ||||||
|  |       ) | ||||||
|  |     end | ||||||
|  |  | ||||||
|  |     it 'disables openstack proposed repository' do | ||||||
|  |       node.override['openstack']['is_release'] = true | ||||||
|  |       expect(chef_run).to_not add_apt_repository('openstack-ppa-proposed').with( | ||||||
|  |         uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu', | ||||||
|  |         distribution: 'xenial-proposed/pike', | ||||||
|         components: ['main'] |         components: ['main'] | ||||||
|       ) |       ) | ||||||
|     end |     end | ||||||
| @@ -67,7 +84,7 @@ describe 'openstack-common::default' do | |||||||
|         'kombu_ssl_certfile' => 'cert_file', |         'kombu_ssl_certfile' => 'cert_file', | ||||||
|         'kombu_ssl_ca_certs' => 'ca_certs_file', |         'kombu_ssl_ca_certs' => 'ca_certs_file', | ||||||
|         'kombu_reconnect_delay' => 123.456, |         'kombu_reconnect_delay' => 123.456, | ||||||
|         'kombu_reconnect_timeout' => 123 |         'kombu_reconnect_timeout' => 123, | ||||||
|       } |       } | ||||||
|       rabbit_opts.each do |key, value| |       rabbit_opts.each do |key, value| | ||||||
|         it "configures rabbit mq #{key}" do |         it "configures rabbit mq #{key}" do | ||||||
|   | |||||||
| @@ -32,11 +32,11 @@ describe 'openstack-common::default' do | |||||||
|               'endpoints' => { |               'endpoints' => { | ||||||
|                 ep_type => { |                 ep_type => { | ||||||
|                   'compute-api' => { |                   'compute-api' => { | ||||||
|                     'uri' => 'http://localhost:8080/v2/%(tenant_id)s' |                     'uri' => 'http://localhost:8080/v2/%(tenant_id)s', | ||||||
|                   } |                   }, | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           } | ||||||
|           allow(subject).to receive(:node).and_return(uri_hash) |           allow(subject).to receive(:node).and_return(uri_hash) | ||||||
|           expect( |           expect( | ||||||
| @@ -50,11 +50,11 @@ describe 'openstack-common::default' do | |||||||
|               'endpoints' => { |               'endpoints' => { | ||||||
|                 ep_type => { |                 ep_type => { | ||||||
|                   'compute-api' => { |                   'compute-api' => { | ||||||
|                     'uri' => 'http://localhost:1234/path' |                     'uri' => 'http://localhost:1234/path', | ||||||
|                   } |                   }, | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           } | ||||||
|           allow(subject).to receive(:node).and_return(uri_hash) |           allow(subject).to receive(:node).and_return(uri_hash) | ||||||
|           expect( |           expect( | ||||||
| @@ -69,11 +69,11 @@ describe 'openstack-common::default' do | |||||||
|                 ep_type => { |                 ep_type => { | ||||||
|                   'compute-api' => { |                   'compute-api' => { | ||||||
|                     'uri' => 'http://localhost', |                     'uri' => 'http://localhost', | ||||||
|                     'host' => 'ignored' |                     'host' => 'ignored', | ||||||
|                   } |                   }, | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           } | ||||||
|           allow(subject).to receive(:node).and_return(uri_hash) |           allow(subject).to receive(:node).and_return(uri_hash) | ||||||
|           expect(subject.send("#{ep_type}_endpoint", 'compute-api').to_s).to eq('http://localhost') |           expect(subject.send("#{ep_type}_endpoint", 'compute-api').to_s).to eq('http://localhost') | ||||||
| @@ -87,11 +87,11 @@ describe 'openstack-common::default' do | |||||||
|                 ep_type => { |                 ep_type => { | ||||||
|                   'compute-api' => { |                   'compute-api' => { | ||||||
|                     'host' => 'localhost', |                     'host' => 'localhost', | ||||||
|                     'port' => '1234' |                     'port' => '1234', | ||||||
|                   } |                   }, | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           } | ||||||
|           allow(subject).to receive(:node).and_return(uri_hash) |           allow(subject).to receive(:node).and_return(uri_hash) | ||||||
|           subject.send("#{ep_type}_endpoint", 'compute-api') |           subject.send("#{ep_type}_endpoint", 'compute-api') | ||||||
|   | |||||||
| @@ -37,103 +37,103 @@ describe 'openstack-common::logging' do | |||||||
|               [ |               [ | ||||||
|                 'keys=root,ceilometer,cinder,glance,horizon,keystone,nova,'\ |                 'keys=root,ceilometer,cinder,glance,horizon,keystone,nova,'\ | ||||||
|                 'neutron,trove,amqplib,sqlalchemy,boto,suds,eventletwsgi,'\ |                 'neutron,trove,amqplib,sqlalchemy,boto,suds,eventletwsgi,'\ | ||||||
|                 'nova_api_openstack_wsgi,nova_osapi_compute_wsgi_server' |                 'nova_api_openstack_wsgi,nova_osapi_compute_wsgi_server', | ||||||
|               ], |               ], | ||||||
|             'logger_root' => |             'logger_root' => | ||||||
|               [ |               [ | ||||||
|                 'level=NOTSET', |                 'level=NOTSET', | ||||||
|                 'handlers=devel' |                 'handlers=devel', | ||||||
|               ], |               ], | ||||||
|             'logger_ceilometer' => |             'logger_ceilometer' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=ceilometer' |                 'qualname=ceilometer', | ||||||
|               ], |               ], | ||||||
|             'logger_cinder' => |             'logger_cinder' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=cinder' |                 'qualname=cinder', | ||||||
|               ], |               ], | ||||||
|             'logger_glance' => |             'logger_glance' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=glance' |                 'qualname=glance', | ||||||
|               ], |               ], | ||||||
|             'logger_horizon' => |             'logger_horizon' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=horizon' |                 'qualname=horizon', | ||||||
|               ], |               ], | ||||||
|             'logger_keystone' => |             'logger_keystone' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=keystone' |                 'qualname=keystone', | ||||||
|               ], |               ], | ||||||
|             'logger_nova' => |             'logger_nova' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=nova' |                 'qualname=nova', | ||||||
|               ], |               ], | ||||||
|             'logger_neutron' => |             'logger_neutron' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=neutron' |                 'qualname=neutron', | ||||||
|               ], |               ], | ||||||
|             'logger_trove' => |             'logger_trove' => | ||||||
|               [ |               [ | ||||||
|                 'level=DEBUG', |                 'level=DEBUG', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=trove' |                 'qualname=trove', | ||||||
|               ], |               ], | ||||||
|             'logger_amqplib' => |             'logger_amqplib' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=stderr', |                 'handlers=stderr', | ||||||
|                 'qualname=amqplib' |                 'qualname=amqplib', | ||||||
|               ], |               ], | ||||||
|             'logger_sqlalchemy' => |             'logger_sqlalchemy' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=stderr', |                 'handlers=stderr', | ||||||
|                 'qualname=sqlalchemy' |                 'qualname=sqlalchemy', | ||||||
|               ], |               ], | ||||||
|             'logger_boto' => |             'logger_boto' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=stderr', |                 'handlers=stderr', | ||||||
|                 'qualname=boto' |                 'qualname=boto', | ||||||
|               ], |               ], | ||||||
|             'logger_suds' => |             'logger_suds' => | ||||||
|               [ |               [ | ||||||
|                 'level=INFO', |                 'level=INFO', | ||||||
|                 'handlers=stderr', |                 'handlers=stderr', | ||||||
|                 'qualname=suds' |                 'qualname=suds', | ||||||
|               ], |               ], | ||||||
|             'logger_eventletwsgi' => |             'logger_eventletwsgi' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=stderr', |                 'handlers=stderr', | ||||||
|                 'qualname=eventlet.wsgi.server' |                 'qualname=eventlet.wsgi.server', | ||||||
|               ], |               ], | ||||||
|             'logger_nova_api_openstack_wsgi' => |             'logger_nova_api_openstack_wsgi' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=nova.api.openstack.wsgi' |                 'qualname=nova.api.openstack.wsgi', | ||||||
|               ], |               ], | ||||||
|             'logger_nova_osapi_compute_wsgi_server' => |             'logger_nova_osapi_compute_wsgi_server' => | ||||||
|               [ |               [ | ||||||
|                 'level=WARNING', |                 'level=WARNING', | ||||||
|                 'handlers=prod,debug', |                 'handlers=prod,debug', | ||||||
|                 'qualname=nova.osapi_compute.wsgi.server' |                 'qualname=nova.osapi_compute.wsgi.server', | ||||||
|               ] |               ], | ||||||
|           }.each do |section, content| |           }.each do |section, content| | ||||||
|             content.each do |line| |             content.each do |line| | ||||||
|               expect(chef_run).to render_config_file(file.name).with_section_content(section, line) |               expect(chef_run).to render_config_file(file.name).with_section_content(section, line) | ||||||
| @@ -156,7 +156,7 @@ describe 'openstack-common::logging' do | |||||||
|             'formatter_syslog_with_name' => |             'formatter_syslog_with_name' => | ||||||
|               'format=%(name)s: %(levelname)s %(message)s', |               'format=%(name)s: %(levelname)s %(message)s', | ||||||
|             'formatter_syslog_debug' => |             'formatter_syslog_debug' => | ||||||
|               'format=%(name)s: %(levelname)s %(module)s.%(funcName)s %(message)s' |               'format=%(name)s: %(levelname)s %(module)s.%(funcName)s %(message)s', | ||||||
|           }.each do |section, content| |           }.each do |section, content| | ||||||
|             expect(chef_run).to render_config_file(file.name).with_section_content(section, content) |             expect(chef_run).to render_config_file(file.name).with_section_content(section, content) | ||||||
|           end |           end | ||||||
| @@ -172,29 +172,29 @@ describe 'openstack-common::logging' do | |||||||
|               [ |               [ | ||||||
|                 'args=(sys.stderr,)', |                 'args=(sys.stderr,)', | ||||||
|                 'class=StreamHandler', |                 'class=StreamHandler', | ||||||
|                 'formatter=debug' |                 'formatter=debug', | ||||||
|               ], |               ], | ||||||
|             'handler_devel' => |             'handler_devel' => | ||||||
|               [ |               [ | ||||||
|                 'args=(sys.stdout,)', |                 'args=(sys.stdout,)', | ||||||
|                 'class=StreamHandler', |                 'class=StreamHandler', | ||||||
|                 'formatter=debug', |                 'formatter=debug', | ||||||
|                 'level=NOTSET' |                 'level=NOTSET', | ||||||
|               ], |               ], | ||||||
|             'handler_prod' => |             'handler_prod' => | ||||||
|               [ |               [ | ||||||
|                 "args=(('/dev/log'), handlers.SysLogHandler.LOG_LOCAL0)", |                 "args=(('/dev/log'), handlers.SysLogHandler.LOG_LOCAL0)", | ||||||
|                 'class=handlers.SysLogHandler', |                 'class=handlers.SysLogHandler', | ||||||
|                 'formatter=syslog_with_name', |                 'formatter=syslog_with_name', | ||||||
|                 'level=INFO' |                 'level=INFO', | ||||||
|               ], |               ], | ||||||
|             'handler_debug' => |             'handler_debug' => | ||||||
|               [ |               [ | ||||||
|                 "args=(('/dev/log'), handlers.SysLogHandler.LOG_LOCAL1)", |                 "args=(('/dev/log'), handlers.SysLogHandler.LOG_LOCAL1)", | ||||||
|                 'class=handlers.SysLogHandler', |                 'class=handlers.SysLogHandler', | ||||||
|                 'formatter=syslog_debug', |                 'formatter=syslog_debug', | ||||||
|                 'level=DEBUG' |                 'level=DEBUG', | ||||||
|               ] |               ], | ||||||
|           }.each do |section, content| |           }.each do |section, content| | ||||||
|             content.each do |line| |             content.each do |line| | ||||||
|               expect(chef_run).to render_config_file(file.name).with_section_content(section, line) |               expect(chef_run).to render_config_file(file.name).with_section_content(section, line) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ describe 'openstack-common::default' do | |||||||
|                                    '::1' => { 'family' => 'inet6', 'prefixlen' => '128', 'scope' => 'Node' }, |                                    '::1' => { 'family' => 'inet6', 'prefixlen' => '128', 'scope' => 'Node' }, | ||||||
|                                    '2001:db8::1' => { 'family' => 'inet6', 'prefixlen' => '64', 'scope' => 'Node' } } }, |                                    '2001:db8::1' => { 'family' => 'inet6', 'prefixlen' => '64', 'scope' => 'Node' } } }, | ||||||
|         'eth0' => { 'addresses' => { '10.0.0.2' => { 'family' => 'inet', 'prefixlen' => '32', 'netmask' => '255.255.255.255', 'scope' => 'Node' }, |         'eth0' => { 'addresses' => { '10.0.0.2' => { 'family' => 'inet', 'prefixlen' => '32', 'netmask' => '255.255.255.255', 'scope' => 'Node' }, | ||||||
|                                      '10.0.0.3' => { 'family' => 'inet', 'prefixlen' => '24', 'netmask' => '255.255.255.0', 'scope' => 'Node' } } } |                                      '10.0.0.3' => { 'family' => 'inet', 'prefixlen' => '24', 'netmask' => '255.255.255.0', 'scope' => 'Node' } } }, | ||||||
|       } |       } | ||||||
|  |  | ||||||
|       runner.converge(described_recipe) |       runner.converge(described_recipe) | ||||||
| @@ -115,9 +115,9 @@ describe 'openstack-common::default' do | |||||||
|         node.automatic['network'] = { |         node.automatic['network'] = { | ||||||
|           'interfaces' => { |           'interfaces' => { | ||||||
|             'lo' => { |             'lo' => { | ||||||
|               'addresses' => nil |               'addresses' => nil, | ||||||
|             } |             }, | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         expect { subject.address_for('lo') } |         expect { subject.address_for('lo') } | ||||||
|           .to raise_error(RuntimeError, 'Interface lo has no addresses assigned') |           .to raise_error(RuntimeError, 'Interface lo has no addresses assigned') | ||||||
| @@ -127,9 +127,9 @@ describe 'openstack-common::default' do | |||||||
|         node.automatic['network'] = { |         node.automatic['network'] = { | ||||||
|           'interfaces' => { |           'interfaces' => { | ||||||
|             'lo' => { |             'lo' => { | ||||||
|               'addresses' => {} |               'addresses' => {}, | ||||||
|             } |             }, | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         expect { subject.address_for('lo') } |         expect { subject.address_for('lo') } | ||||||
|           .to raise_error(RuntimeError, 'Interface lo has no addresses assigned') |           .to raise_error(RuntimeError, 'Interface lo has no addresses assigned') | ||||||
| @@ -144,11 +144,11 @@ describe 'openstack-common::default' do | |||||||
|                   'family' => 'inet', |                   'family' => 'inet', | ||||||
|                   'prefixlen' => '8', |                   'prefixlen' => '8', | ||||||
|                   'netmask' => '255.0.0.0', |                   'netmask' => '255.0.0.0', | ||||||
|                   'scope' => 'Node' |                   'scope' => 'Node', | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         expect { subject.address_for('lo', 'inet6') } |         expect { subject.address_for('lo', 'inet6') } | ||||||
|           .to raise_error(RuntimeError, 'No address for family inet6 found') |           .to raise_error(RuntimeError, 'No address for family inet6 found') | ||||||
| @@ -163,11 +163,11 @@ describe 'openstack-common::default' do | |||||||
|                   'family' => 'inet', |                   'family' => 'inet', | ||||||
|                   'prefixlen' => '32', |                   'prefixlen' => '32', | ||||||
|                   'netmask' => '255.255.255.255', |                   'netmask' => '255.255.255.255', | ||||||
|                   'scope' => 'Node' |                   'scope' => 'Node', | ||||||
|                 } |                 }, | ||||||
|               } |               }, | ||||||
|             } |             }, | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         expect { subject.address_for('lo', 'inet') } |         expect { subject.address_for('lo', 'inet') } | ||||||
|           .to raise_error(RuntimeError, 'No address for family inet found') |           .to raise_error(RuntimeError, 'No address for family inet found') | ||||||
|   | |||||||
| @@ -49,7 +49,7 @@ describe 'openstack-common::default' do | |||||||
|       it 'returns memcached list' do |       it 'returns memcached list' do | ||||||
|         nodes = [ |         nodes = [ | ||||||
|           { 'memcached' => { 'listen' => '1.1.1.1', 'port' => '11211' } }, |           { 'memcached' => { 'listen' => '1.1.1.1', 'port' => '11211' } }, | ||||||
|           { 'memcached' => { 'listen' => '2.2.2.2', 'port' => '11211' } } |           { 'memcached' => { 'listen' => '2.2.2.2', 'port' => '11211' } }, | ||||||
|         ] |         ] | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node) |         allow(subject).to receive(:node).and_return(chef_run.node) | ||||||
|         allow(subject).to receive(:search_for) |         allow(subject).to receive(:search_for) | ||||||
| @@ -64,7 +64,7 @@ describe 'openstack-common::default' do | |||||||
|         nodes = [ |         nodes = [ | ||||||
|           { 'memcached' => { 'listen' => '3.3.3.3', 'port' => '11211' } }, |           { 'memcached' => { 'listen' => '3.3.3.3', 'port' => '11211' } }, | ||||||
|           { 'memcached' => { 'listen' => '1.1.1.1', 'port' => '11211' } }, |           { 'memcached' => { 'listen' => '1.1.1.1', 'port' => '11211' } }, | ||||||
|           { 'memcached' => { 'listen' => '2.2.2.2', 'port' => '11211' } } |           { 'memcached' => { 'listen' => '2.2.2.2', 'port' => '11211' } }, | ||||||
|         ] |         ] | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node) |         allow(subject).to receive(:node).and_return(chef_run.node) | ||||||
|         allow(subject).to receive(:search_for) |         allow(subject).to receive(:search_for) | ||||||
| @@ -78,8 +78,8 @@ describe 'openstack-common::default' do | |||||||
|       it 'returns memcached servers as defined by attributes' do |       it 'returns memcached servers as defined by attributes' do | ||||||
|         nodes = { |         nodes = { | ||||||
|           'openstack' => { |           'openstack' => { | ||||||
|             'memcached_servers' => ['1.1.1.1:11211', '2.2.2.2:11211'] |             'memcached_servers' => ['1.1.1.1:11211', '2.2.2.2:11211'], | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node.merge(nodes)) |         allow(subject).to receive(:node).and_return(chef_run.node.merge(nodes)) | ||||||
|         expect( |         expect( | ||||||
| @@ -90,8 +90,8 @@ describe 'openstack-common::default' do | |||||||
|       it 'returns empty memcached servers as defined by attributes' do |       it 'returns empty memcached servers as defined by attributes' do | ||||||
|         nodes = { |         nodes = { | ||||||
|           'openstack' => { |           'openstack' => { | ||||||
|             'memcached_servers' => [] |             'memcached_servers' => [], | ||||||
|           } |           }, | ||||||
|         } |         } | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node.merge(nodes)) |         allow(subject).to receive(:node).and_return(chef_run.node.merge(nodes)) | ||||||
|         expect( |         expect( | ||||||
| @@ -104,7 +104,7 @@ describe 'openstack-common::default' do | |||||||
|       it 'returns rabbit servers' do |       it 'returns rabbit servers' do | ||||||
|         nodes = [ |         nodes = [ | ||||||
|           { 'openstack' => { 'mq' => { 'listen' => '1.1.1.1' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, |           { 'openstack' => { 'mq' => { 'listen' => '1.1.1.1' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, | ||||||
|           { 'openstack' => { 'mq' => { 'listen' => '2.2.2.2' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } } |           { 'openstack' => { 'mq' => { 'listen' => '2.2.2.2' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, | ||||||
|         ] |         ] | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node) |         allow(subject).to receive(:node).and_return(chef_run.node) | ||||||
|         allow(subject).to receive(:search_for) |         allow(subject).to receive(:search_for) | ||||||
| @@ -118,7 +118,7 @@ describe 'openstack-common::default' do | |||||||
|         nodes = [ |         nodes = [ | ||||||
|           { 'openstack' => { 'mq' => { 'listen' => '3.3.3.3' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, |           { 'openstack' => { 'mq' => { 'listen' => '3.3.3.3' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, | ||||||
|           { 'openstack' => { 'mq' => { 'listen' => '1.1.1.1' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, |           { 'openstack' => { 'mq' => { 'listen' => '1.1.1.1' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, | ||||||
|           { 'openstack' => { 'mq' => { 'listen' => '2.2.2.2' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } } |           { 'openstack' => { 'mq' => { 'listen' => '2.2.2.2' }, 'endpoints' => { 'mq' => { 'port' => '5672' } } } }, | ||||||
|         ] |         ] | ||||||
|         allow(subject).to receive(:node).and_return(chef_run.node) |         allow(subject).to receive(:node).and_return(chef_run.node) | ||||||
|         allow(subject).to receive(:search_for) |         allow(subject).to receive(:search_for) | ||||||
|   | |||||||
| @@ -8,12 +8,12 @@ LOG_LEVEL = :fatal | |||||||
| UBUNTU_OPTS = { | UBUNTU_OPTS = { | ||||||
|   platform: 'ubuntu', |   platform: 'ubuntu', | ||||||
|   version: '16.04', |   version: '16.04', | ||||||
|   log_level: LOG_LEVEL |   log_level: LOG_LEVEL, | ||||||
| }.freeze | }.freeze | ||||||
| REDHAT_OPTS = { | REDHAT_OPTS = { | ||||||
|   platform: 'redhat', |   platform: 'redhat', | ||||||
|   version: '7.1', |   version: '7.1', | ||||||
|   log_level: LOG_LEVEL |   log_level: LOG_LEVEL, | ||||||
| }.freeze | }.freeze | ||||||
| # We set a default platform for non-platform specific test cases | # We set a default platform for non-platform specific test cases | ||||||
| CHEFSPEC_OPTS = UBUNTU_OPTS | CHEFSPEC_OPTS = UBUNTU_OPTS | ||||||
| @@ -32,9 +32,9 @@ shared_context 'common-stubs' do | |||||||
|           'openstack' => { |           'openstack' => { | ||||||
|             'identity' => { |             'identity' => { | ||||||
|               'admin_tenant_name' => 'admin', |               'admin_tenant_name' => 'admin', | ||||||
|               'admin_user' => 'admin' |               'admin_user' => 'admin', | ||||||
|             } |             }, | ||||||
|           } |           }, | ||||||
|         }] |         }] | ||||||
|       ) |       ) | ||||||
|     allow_any_instance_of(Chef::Recipe).to receive(:get_password) |     allow_any_instance_of(Chef::Recipe).to receive(:get_password) | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ describe 'Openstack uri' do | |||||||
|       hash = { |       hash = { | ||||||
|         'port' => 8888, |         'port' => 8888, | ||||||
|         'path' => '/path', |         'path' => '/path', | ||||||
|         'uri'  => uri |         'uri'  => uri, | ||||||
|       } |       } | ||||||
|       result = subject.uri_from_hash(hash) |       result = subject.uri_from_hash(hash) | ||||||
|       expect(result).to be_a URI |       expect(result).to be_a URI | ||||||
| @@ -25,7 +25,7 @@ describe 'Openstack uri' do | |||||||
|         'scheme' => 'https', |         'scheme' => 'https', | ||||||
|         'port'   => 8888, |         'port'   => 8888, | ||||||
|         'path'   => '/path', |         'path'   => '/path', | ||||||
|         'host'   => 'localhost' |         'host'   => 'localhost', | ||||||
|       } |       } | ||||||
|       expect( |       expect( | ||||||
|         subject.uri_from_hash(hash).to_s |         subject.uri_from_hash(hash).to_s | ||||||
| @@ -36,7 +36,7 @@ describe 'Openstack uri' do | |||||||
|       uri = 'https://localhost' |       uri = 'https://localhost' | ||||||
|       hash = { |       hash = { | ||||||
|         'scheme' => 'https', |         'scheme' => 'https', | ||||||
|         'host'   => 'localhost' |         'host'   => 'localhost', | ||||||
|       } |       } | ||||||
|       expect( |       expect( | ||||||
|         subject.uri_from_hash(hash).to_s |         subject.uri_from_hash(hash).to_s | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ describe 'Openstack wrappers' do | |||||||
|   describe '#recipe_included' do |   describe '#recipe_included' do | ||||||
|     it 'returns boolean for recipe list' do |     it 'returns boolean for recipe list' do | ||||||
|       node_hash = { |       node_hash = { | ||||||
|         'recipes' => 'included_recipe' |         'recipes' => 'included_recipe', | ||||||
|       } |       } | ||||||
|       allow(subject).to receive(:node).and_return(node_hash) |       allow(subject).to receive(:node).and_return(node_hash) | ||||||
|       expect(subject.recipe_included?('included_recipe')).to be_truthy |       expect(subject.recipe_included?('included_recipe')).to be_truthy | ||||||
| @@ -19,7 +19,7 @@ describe 'Openstack wrappers' do | |||||||
|   describe '#role_included' do |   describe '#role_included' do | ||||||
|     it 'returns boolean for role list' do |     it 'returns boolean for role list' do | ||||||
|       node_hash = { |       node_hash = { | ||||||
|         'roles' => 'included_role' |         'roles' => 'included_role', | ||||||
|       } |       } | ||||||
|       allow(subject).to receive(:node).and_return(node_hash) |       allow(subject).to receive(:node).and_return(node_hash) | ||||||
|       expect(subject.role_included?('included_role')).to be_truthy |       expect(subject.role_included?('included_role')).to be_truthy | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Samuel Cassiba
					Samuel Cassiba