[Saga-devel] saga SVN commit 3346: /trunk/

amerzky at cct.lsu.edu amerzky at cct.lsu.edu
Wed Jan 21 18:54:55 CST 2009


User: amerzky
Date: 2009/01/21 06:54 PM

Modified:
 /trunk/adaptors/aws/aws_job/
  aws_job_service.cpp
 /trunk/adaptors/ssh/ssh_job/
  ssh_job_service.cpp, ssh_job_service.hpp
 /trunk/examples/misc/
  aws.cpp, context.cpp
 /trunk/saga/saga/adaptors/utils/process/
  process.cpp, process.hpp

Log:
 various pending fixes
 A

File Changes:

Directory: /trunk/adaptors/aws/aws_job/
=======================================

File [modified]: aws_job_service.cpp
Delta lines: +1 -0
===================================================================
--- trunk/adaptors/aws/aws_job/aws_job_service.cpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/adaptors/aws/aws_job/aws_job_service.cpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -365,6 +365,7 @@
       proc.set_cmd ("/usr/bin/ssh");
 
       proc.clear_args ();
+      proc.clear_out  ();
       proc.add_args ("-o", "StrictHostKeyChecking=no");
       proc.add_args ("-i", userkey_);
       proc.add_arg  (user_ + "@" + vm_ip_);

Directory: /trunk/examples/misc/
================================

File [modified]: aws.cpp
Delta lines: +5 -5
===================================================================
--- trunk/examples/misc/aws.cpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/examples/misc/aws.cpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -72,13 +72,13 @@
 
     jd.set_attribute (saga::job::attributes::description_executable,  "hostname");
     jd.set_attribute (saga::job::attributes::description_executable, "/usr/local/packages/saga-1.1/bin/saga-file");
-    jd.set_attribute (saga::job::attributes::description_executable, "/bin/ls");
+    jd.set_attribute (saga::job::attributes::description_executable, "env");
     jd.set_attribute (saga::job::attributes::description_interactive, "True");
 
     std::vector <std::string> args;
 
     // args.push_back ("list_dir");
-    args.push_back ("/");
+    // args.push_back ("/");
 
     jd.set_vector_attribute (saga::job::attributes::description_arguments, args);
 
@@ -94,11 +94,11 @@
     // "https://vm02.cct.lsu.edu:8443/"
 
     // create a new instance on ec2, and run a test job
- // test_cloud (jd, "ec2");
- // test_cloud (jd, "ec2",        "i-d642c7bf");
+    test_cloud (jd, "ec2");
+ // test_cloud (jd, "ec2",        "i-a7f87bce");
 
     // same for eucalyptus
-    test_cloud (jd, "eucalyptus");
+ // test_cloud (jd, "eucalyptus");
  // test_cloud (jd, "eucalyptus", "i-4C1308D3");
 
     // same for nimbus

File [modified]: context.cpp
Delta lines: +1 -1
===================================================================
--- trunk/examples/misc/context.cpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/examples/misc/context.cpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -53,7 +53,7 @@
   try {
     saga::context c (type);
 
-    c.set_attribute ("UserID", "root");
+ // c.set_attribute ("UserID", "root");
     c.set_defaults  ();
 
     dump_context (c);

Directory: /trunk/saga/saga/adaptors/utils/process/
===================================================

File [modified]: process.cpp
Delta lines: +10 -0
===================================================================
--- trunk/saga/saga/adaptors/utils/process/process.cpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/saga/saga/adaptors/utils/process/process.cpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -268,6 +268,16 @@
       {
         return err_v_;
       }
+
+      void process::clear_out (void)
+      {
+        out_v_.clear ();
+      }
+
+      void process::clear_err (void)
+      {
+        err_v_.clear ();
+      }
       ///////////////////////////////////////////////////////////////////////////////
 
     } // namespace utils

File [modified]: process.hpp
Delta lines: +3 -0
===================================================================
--- trunk/saga/saga/adaptors/utils/process/process.hpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/saga/saga/adaptors/utils/process/process.hpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -72,6 +72,9 @@
 
           std::vector <std::string>  run_sync  (void);
 
+          void                       clear_out (void);
+          void                       clear_err (void);
+
           boost::process::pistream & get_out   (void);
           boost::process::pistream & get_err   (void);
 

Directory: /trunk/adaptors/ssh/ssh_job/
=======================================

File [modified]: ssh_job_service.cpp
Delta lines: +9 -7
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job_service.cpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/adaptors/ssh/ssh_job/ssh_job_service.cpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -138,6 +138,13 @@
       loc_ssh_key_priv_  = ctx_.get_attribute ("UserKey");
       loc_ssh_key_pub_   = ctx_.get_attribute ("UserCert");
 
+      struct passwd * p = ::getpwuid (::getuid ());
+      if ( p == NULL )
+      {
+        local_user_ = "root";
+      }
+      local_user_ = p->pw_name;
+      
 
       if ( ctx_.attribute_exists ("UserKey") )
       {
@@ -145,12 +152,7 @@
       } 
       else
       {
-        struct passwd * p = ::getpwuid (::getuid ());
-        if ( p == NULL )
-        {
-          user_ = "root";
-        }
-        user_ = p->pw_name;
+        user_ = local_user_;
       }
 
 
@@ -184,7 +186,7 @@
       env_.push_back (std::string ("SAGA_PARENT_JOBID") + "=" + parent_id_);
       env_.push_back (std::string ("SAGA_SSH_KEY")      + "=" + rem_ssh_key_pub_);
       env_.push_back (std::string ("SAGA_SSH_PUB")      + "=" + rem_ssh_key_priv_);
-      env_.push_back (std::string ("SAGA_SSH_USER")     + "=" + user_);
+      env_.push_back (std::string ("SAGA_SSH_USER")     + "=" + local_user_);
 
 
       // prepare the remote host

File [modified]: ssh_job_service.hpp
Delta lines: +2 -1
===================================================================
--- trunk/adaptors/ssh/ssh_job/ssh_job_service.hpp	2009-01-22 00:44:31 UTC (rev 3345)
+++ trunk/adaptors/ssh/ssh_job/ssh_job_service.hpp	2009-01-22 00:54:23 UTC (rev 3346)
@@ -52,9 +52,10 @@
       TR1::shared_ptr <saga::job::service> js_;
 
       std::string                          host_;
-      std::string                          user_;
       std::string                          key_;
       std::string                          port_;
+      std::string                          user_;
+      std::string                          local_user_;
 
       std::string                          ssh_bin_;
       std::string                          scp_bin_;



More information about the saga-devel mailing list