From 394e614ab2b7334e002176b07b6ef41ae8e950d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Gagne=CC=81?= Date: Mon, 1 Jul 2013 22:17:04 -0400 Subject: [PATCH] Various Puppet lint fixes * Fix following warnings: * case statement without a default case * double quoted string containing no variables * indentation of => is not properly aligned * mode should be represented as a 4 digit octal value or symbolic mode * quoted boolean value found * unquoted file mode * variable not enclosed in {} * Fix following errors: * trailing whitespace found * two-space soft tabs not used * Remove quotes around class in include/require statements Change-Id: Ia407416e51c09fb303675863afa68f526a37abcf --- manifests/all.pp | 8 ++++---- manifests/auth_file.pp | 2 +- manifests/client.pp | 12 ++++++------ manifests/compute.pp | 4 ++-- manifests/controller.pp | 10 +++++----- manifests/glance.pp | 2 +- manifests/nova/controller.pp | 2 ++ manifests/quantum.pp | 6 +++--- manifests/repo/epel.pp | 2 +- manifests/repo/rdo.pp | 2 +- manifests/swift/proxy.pp | 2 +- manifests/swift/storage-node.pp | 4 +++- tests/all.pp | 2 +- tests/cloudcontroller.pp | 2 +- tests/compute.pp | 2 +- 15 files changed, 33 insertions(+), 29 deletions(-) diff --git a/manifests/all.pp b/manifests/all.pp index e63b338..047a03b 100644 --- a/manifests/all.pp +++ b/manifests/all.pp @@ -237,7 +237,7 @@ class openstack::all ( if $glance_api_servers { $glance_api_servers_real = $glance_api_servers } else { - $glance_api_servers_real = "$internal_address_real:9292" + $glance_api_servers_real = "${internal_address_real}:9292" } @@ -385,8 +385,8 @@ class openstack::all ( # Glance glance_api_servers => $glance_api_servers_real, # VNC - vnc_enabled => $vnc_enabled, - vncproxy_host => $vncproxy_host_real, + vnc_enabled => $vnc_enabled, + vncproxy_host => $vncproxy_host_real, # General verbose => $verbose, enabled => $enabled, @@ -445,7 +445,7 @@ class openstack::all ( } else { if ! $fixed_range { - fail("Must specify the fixed range when using nova-networks") + fail('Must specify the fixed range when using nova-networks') } if $multi_host { diff --git a/manifests/auth_file.pp b/manifests/auth_file.pp index c54e58b..96d8def 100644 --- a/manifests/auth_file.pp +++ b/manifests/auth_file.pp @@ -9,7 +9,7 @@ class openstack::auth_file( $keystone_admin_token = 'keystone_admin_token', $admin_user = 'admin', $admin_tenant = 'admin', - $use_no_cache = 'true' + $use_no_cache = true ) { file { '/root/openrc': content => diff --git a/manifests/client.pp b/manifests/client.pp index 8bc8e66..8b4e3c6 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -32,26 +32,26 @@ class openstack::client ( ) { if $ceilometer { - include 'ceilometer::client' + include ceilometer::client } if $cinder { - include 'cinder::client' + include cinder::client } if $glance { - include 'glance::client' + include glance::client } if $keystone { - include 'keystone::client' + include keystone::client } if $nova { - include 'nova::client' + include nova::client } if $quantum { - include 'quantum::client' + include quantum::client } } diff --git a/manifests/compute.pp b/manifests/compute.pp index 395612f..adce51e 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -44,7 +44,7 @@ class openstack::compute ( $enable_ovs_agent = true, $enable_l3_agent = false, $enable_dhcp_agent = false, - $quantum_auth_url = "http://127.0.0.1:35357/v2.0", + $quantum_auth_url = 'http://127.0.0.1:35357/v2.0', $keystone_host = '127.0.0.1', $quantum_host = '127.0.0.1', $ovs_local_ip = false, @@ -137,7 +137,7 @@ class openstack::compute ( if ! $quantum { if ! $fixed_range { - fail("Must specify the fixed range when using nova-networks") + fail('Must specify the fixed range when using nova-networks') } if $multi_host { diff --git a/manifests/controller.pp b/manifests/controller.pp index 1226ab8..851aa7d 100644 --- a/manifests/controller.pp +++ b/manifests/controller.pp @@ -350,8 +350,8 @@ class openstack::controller ( # Glance glance_api_servers => $glance_api_servers, # VNC - vnc_enabled => $vnc_enabled, - vncproxy_host => $vncproxy_host_real, + vnc_enabled => $vnc_enabled, + vncproxy_host => $vncproxy_host_real, # General verbose => $verbose, enabled => $enabled, @@ -368,9 +368,9 @@ class openstack::controller ( fail('quantum_db_password must be set when configuring quantum') } - if ! $bridge_interface { - fail('bridge_interface must be set when configuring quantum') - } + if ! $bridge_interface { + fail('bridge_interface must be set when configuring quantum') + } class { 'openstack::quantum': # Database diff --git a/manifests/glance.pp b/manifests/glance.pp index e83e141..e11f9ec 100644 --- a/manifests/glance.pp +++ b/manifests/glance.pp @@ -44,7 +44,7 @@ class openstack::glance ( $backend = 'file', $swift_store_user = false, $swift_store_key = false, - $swift_store_auth_address = "http://127.0.0.1:5000/v2.0/", + $swift_store_auth_address = 'http://127.0.0.1:5000/v2.0/', $verbose = 'False', $enabled = true ) { diff --git a/manifests/nova/controller.pp b/manifests/nova/controller.pp index 1d7ca22..f36d74f 100644 --- a/manifests/nova/controller.pp +++ b/manifests/nova/controller.pp @@ -83,6 +83,8 @@ class openstack::nova::controller ( 'mysql': { $nova_db = "mysql://${nova_db_user}:${nova_db_password}@${db_host}/${nova_db_dbname}" } + default: { + } } if ($glance_api_servers == undef) { diff --git a/manifests/quantum.pp b/manifests/quantum.pp index 4d2fa7d..d57d6c3 100644 --- a/manifests/quantum.pp +++ b/manifests/quantum.pp @@ -222,7 +222,7 @@ class openstack::quantum ( } } if $enable_l3_agent { - class {"quantum::agents::l3": + class { 'quantum::agents::l3': use_namespaces => true, } } @@ -236,7 +236,7 @@ class openstack::quantum ( shared_secret => $shared_secret, auth_url => $auth_url, metadata_ip => $metadata_ip, - } - } + } + } } diff --git a/manifests/repo/epel.pp b/manifests/repo/epel.pp index 2e15055..55fda11 100644 --- a/manifests/repo/epel.pp +++ b/manifests/repo/epel.pp @@ -18,7 +18,7 @@ class openstack::repo::epel { source => 'puppet:///modules/openstack/RPM-GPG-KEY-EPEL-6', owner => root, group => root, - mode => 644, + mode => '0644', before => Yumrepo['epel'], } Yumrepo['epel'] -> Package<||> diff --git a/manifests/repo/rdo.pp b/manifests/repo/rdo.pp index 2ed6b8b..1f9542e 100644 --- a/manifests/repo/rdo.pp +++ b/manifests/repo/rdo.pp @@ -23,7 +23,7 @@ class openstack::repo::rdo { source => 'puppet:///modules/openstack/RPM-GPG-KEY-RDO-Grizzly', owner => root, group => root, - mode => 644, + mode => '0644', before => Yumrepo['rdo-release'], } Yumrepo['rdo-release'] -> Package<||> diff --git a/manifests/swift/proxy.pp b/manifests/swift/proxy.pp index c0b66ba..43a7825 100644 --- a/manifests/swift/proxy.pp +++ b/manifests/swift/proxy.pp @@ -103,7 +103,7 @@ class openstack::swift::proxy ( # exports rsync gets that can be used to sync the ring files @@swift::ringsync { ['account', 'object', 'container']: - ring_server => $swift_local_net_ip + ring_server => $swift_local_net_ip } # deploy a script that can be used for testing diff --git a/manifests/swift/storage-node.pp b/manifests/swift/storage-node.pp index 841e703..10fee85 100644 --- a/manifests/swift/storage-node.pp +++ b/manifests/swift/storage-node.pp @@ -25,13 +25,15 @@ class openstack::swift::storage-node ( require => Class['swift'], } } - # make xfs filesystem on physical disk and mount them + # make xfs filesystem on physical disk and mount them 'disk': { swift::storage::disk {$storage_devices: mnt_base_dir => $storage_mnt_base_dir, byte_size => $byte_size, } } + default: { + } } # install all swift storage servers together diff --git a/tests/all.pp b/tests/all.pp index 56758ee..5248700 100644 --- a/tests/all.pp +++ b/tests/all.pp @@ -1,4 +1,4 @@ -class { 'openstack::all': +class { 'openstack::all': public_address => $::ipaddress_eth0, mysql_root_password => 'password', rabbit_password => 'password', diff --git a/tests/cloudcontroller.pp b/tests/cloudcontroller.pp index 79b2453..3d8f0f3 100644 --- a/tests/cloudcontroller.pp +++ b/tests/cloudcontroller.pp @@ -1,4 +1,4 @@ -class { 'openstack::controller': +class { 'openstack::controller': public_address => $::ipaddress_eth0, mysql_root_password => 'password', allowed_hosts => ['127.0.0.%', '192.168.1.%'], diff --git a/tests/compute.pp b/tests/compute.pp index 6dd835d..206f03b 100644 --- a/tests/compute.pp +++ b/tests/compute.pp @@ -1,4 +1,4 @@ -class { 'openstack::nova::compute': +class { 'openstack::nova::compute': exported_resources => false, sql_connection => 'mysql://foo:bar@192.168.1.1/nova', glance_api_servers => '192.168.1.1:9292',