[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 05/26] power handling: Break out power_cycle_parse_method



Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/TestSupport.pm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 29108423..68b51728 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -917,10 +917,10 @@ sub serial_fetch_logs ($) {
 
 #---------- power cycling ----------
 
-sub power_cycle_host_setup ($) {
-    my ($ho) = @_;
+sub power_cycle_parse_method ($$) {
+    my ($ho, $spec) = @_;
     my $methobjs = [ ];
-    foreach my $meth (split /\;\s*/, ($ho->{Power} // 'unsupported')) {
+    foreach my $meth (split /\;\s*/, $spec) {
         if ($meth eq 'nest') {
             push @$methobjs, $meth;
         } elsif ($meth =~ m{^(\d+)(?:/(\d+))$}) {
@@ -930,7 +930,13 @@ sub power_cycle_host_setup ($) {
             push @$methobjs, get_host_method_object($ho,'PDU',$meth);
         }
     }
-    $ho->{PowerMethobjs} = $methobjs;
+    return $methobjs;
+}
+
+sub power_cycle_host_setup ($) {
+    my ($ho) = @_;
+    $spec = ($ho->{Power} // 'unsupported');
+    $ho->{PowerMethobjs} = power_cycle_parse_method($ho,$spec);
 }
 
 sub power_cycle_sleep ($) {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.