Browse Source

Merge "Inherit pyvers from openstacklib::defaults"

Zuul 3 months ago
parent
commit
f54faaf004
2 changed files with 4 additions and 14 deletions
  1. 3
    9
      manifests/params.pp
  2. 1
    5
      spec/classes/glare_client_spec.rb

+ 3
- 9
manifests/params.pp View File

@@ -2,13 +2,7 @@
2 2
 #
3 3
 class glare::params {
4 4
   include ::openstacklib::defaults
5
-
6
-  if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
7
-    ($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
8
-    $pyvers = '3'
9
-  } else {
10
-    $pyvers = ''
11
-  }
5
+  $pyvers = $::openstacklib::defaults::pyvers
12 6
 
13 7
   $group = 'glare'
14 8
   $client_package_name = "python${pyvers}-glareclient"
@@ -18,9 +12,9 @@ class glare::params {
18 12
       $glare_package_name    = 'openstack-glare'
19 13
       $glare_service_name    = 'openstack-glare-api'
20 14
       if ($::operatingsystem != 'fedora' and versioncmp($::operatingsystemrelease, '7') < 0) {
21
-        $pyceph_package_name = 'python-ceph'
15
+        $pyceph_package_name = "python${pyvers}-ceph"
22 16
       } else {
23
-        $pyceph_package_name = 'python-rbd'
17
+        $pyceph_package_name = "python${pyvers}-rbd"
24 18
       }
25 19
     }
26 20
     'Debian': {

+ 1
- 5
spec/classes/glare_client_spec.rb View File

@@ -27,11 +27,7 @@ describe 'glare::client' do
27 27
       let(:platform_params) do
28 28
         case facts[:osfamily]
29 29
         when 'Debian'
30
-          if facts[:os_package_type] == 'debian'
31
-            { :client_package_name => 'python3-glareclient' }
32
-          else
33
-            { :client_package_name => 'python-glareclient' }
34
-          end
30
+          { :client_package_name => 'python3-glareclient' }
35 31
         when 'RedHat'
36 32
           { :client_package_name => 'python-glareclient' }
37 33
         end

Loading…
Cancel
Save