]> rtime.felk.cvut.cz Git - novaboot.git/commitdiff
Move "use LWP" to amt block
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 14 Feb 2014 16:32:25 +0000 (17:32 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 14 Feb 2014 17:27:26 +0000 (18:27 +0100)
Novaboot should not fail when LWP is not installed and AMT is not used.

novaboot

index b66863e9e47c8b385a11790f4ed183c7de240c86..e394a9a4468cd5505d8c15a521fab005b04fef71 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -28,8 +28,6 @@ use IPC::Open2;
 use POSIX qw(:errno_h);
 use Cwd qw(getcwd abs_path);
 use Expect;
-use LWP::UserAgent;
-use LWP::Authen::Digest;  
 
 # always flush
 $| = 1;
@@ -547,6 +545,8 @@ elsif ($serial) {
     print "novaboot: Running: $remote_cmd\n";
     $exp = Expect->spawn($remote_cmd);
 } elsif (defined $amt){    
+    use LWP::UserAgent;
+    use LWP::Authen::Digest;  
     sub genXML { #HOST, username, password, schema, className, pstate
         my ($host, $username, $password, $schema, $className, $pstate) = @_;
         #AMT numbers for PowerStateChange: 2 on, 4 standby, 7 hibernate, 8 off,