From 3c9c0e4d065b6d127c117c0b2d5d3753cdb7680b Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Wed, 7 Aug 2013 13:20:33 -0700 Subject: [PATCH] Fix puppet-lint failures This commit does two things to resolve puppet-lint failures: 1. Split device_endpoint into its own file Previously, the device_endpoint class was defined inside of the storage-node.pp class. This resulted in puppet-lint failures. This commit moves the define to its own file in order to conform to module standards. 2. Modify spacing of a line in openstack::provision This second change is actually a limitation in puppet-lint, I have file: https://github.com/rodjek/puppet-lint/issues/213 to track it. Change-Id: If83eb7fb740c5632711da6ab0f91bf6220c5830e --- manifests/provision.pp | 2 +- manifests/swift/device_endpoint.pp | 17 +++++++++++++++++ manifests/swift/storage-node.pp | 17 +---------------- 3 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 manifests/swift/device_endpoint.pp diff --git a/manifests/provision.pp b/manifests/provision.pp index a653a28..3dd6c3c 100644 --- a/manifests/provision.pp +++ b/manifests/provision.pp @@ -187,7 +187,7 @@ class openstack::provision( Keystone_user[$alt_username], Glance_image[$image_name], Quantum_network[$public_network_name], - ], + ], } } diff --git a/manifests/swift/device_endpoint.pp b/manifests/swift/device_endpoint.pp new file mode 100644 index 0000000..d281e72 --- /dev/null +++ b/manifests/swift/device_endpoint.pp @@ -0,0 +1,17 @@ +# +# Exports endpoints for all swift devices +# +define openstack::swift::device_endpoint ($swift_local_net_ip, $zone, $weight) { + @@ring_object_device { "${swift_local_net_ip}:6000/${name}": + zone => $zone, + weight => $weight, + } + @@ring_container_device { "${swift_local_net_ip}:6001/${name}": + zone => $zone, + weight => $weight, + } + @@ring_account_device { "${swift_local_net_ip}:6002/${name}": + zone => $zone, + weight => $weight, + } +} diff --git a/manifests/swift/storage-node.pp b/manifests/swift/storage-node.pp index 10fee85..6d2b602 100644 --- a/manifests/swift/storage-node.pp +++ b/manifests/swift/storage-node.pp @@ -41,22 +41,7 @@ class openstack::swift::storage-node ( storage_local_net_ip => $swift_local_net_ip, } - define device_endpoint ($swift_local_net_ip, $zone, $weight) { - @@ring_object_device { "${swift_local_net_ip}:6000/${name}": - zone => $zone, - weight => $weight, - } - @@ring_container_device { "${swift_local_net_ip}:6001/${name}": - zone => $zone, - weight => $weight, - } - @@ring_account_device { "${swift_local_net_ip}:6002/${name}": - zone => $zone, - weight => $weight, - } - } - - device_endpoint { $storage_devices: + openstack::swift::device_endpoint { $storage_devices: swift_local_net_ip => $swift_local_net_ip, zone => $swift_zone, weight => $storage_weight,