fix get_services for rspecs pgv2 and geniv3
authorMohamed Larabi <mohamed.larabi@inria.fr>
Tue, 26 Nov 2013 15:49:01 +0000 (16:49 +0100)
committerMohamed Larabi <mohamed.larabi@inria.fr>
Tue, 26 Nov 2013 15:49:01 +0000 (16:49 +0100)
sfa/rspecs/elements/v3/services.py
sfa/rspecs/elements/versions/pgv2Services.py

index 7211108..83b300b 100644 (file)
@@ -41,16 +41,16 @@ class Services:
         for services_elem in xml.xpath('./default:services | ./services'):
             service = ServicesElement(services_elem.attrib, services_elem)
             # get install 
-            install_elems = xml.xpath('./default:install | ./install')
+            install_elems = services_elem.xpath('./default:install | ./install')
             service['install'] = [install_elem.get_instance(Install) for install_elem in install_elems]
             # get execute
-            execute_elems = xml.xpath('./default:execute | ./execute')
+            execute_elems = services_elem.xpath('./default:execute | ./execute')
             service['execute'] = [execute_elem.get_instance(Execute) for execute_elem in execute_elems]
             # get login
-            login_elems = xml.xpath('./default:login | ./login')
+            login_elems = services_elem.xpath('./default:login | ./login')
             service['login'] = [login_elem.get_instance(Login) for login_elem in login_elems]
             
-            ssh_user_elems = xml.xpath('./ssh-user:service_user | ./service_user')
+            ssh_user_elems = services_elem.xpath('./ssh-user:service_user | ./service_user')
             services_user = []    
             for ssh_user_elem in ssh_user_elems:
                 services_user = ssh_user_elem.get_instance(None, fields=['login', 'user_urn'])
index ff9e9d1..5cdf22c 100644 (file)
@@ -30,13 +30,13 @@ class PGv2Services:
         for services_elem in xml.xpath('./default:services | ./services'):
             service = ServicesElement(services_elem.attrib, services_elem)
             # get install 
-            install_elems = xml.xpath('./default:install | ./install')
+            install_elems = services_elem.xpath('./default:install | ./install')
             service['install'] = [install_elem.get_instance(Install) for install_elem in install_elems]
             # get execute
-            execute_elems = xml.xpath('./default:execute | ./execute')
+            execute_elems = services_elem.xpath('./default:execute | ./execute')
             service['execute'] = [execute_elem.get_instance(Execute) for execute_elem in execute_elems]
             # get login
-            login_elems = xml.xpath('./default:login | ./login')
+            login_elems = services_elem.xpath('./default:login | ./login')
             service['login'] = [login_elem.get_instance(Login) for login_elem in login_elems]
             services.append(service)  
         return services