Changeset c2dbca8


Ignore:
Timestamp:
Jul 22, 2009 9:55:54 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
4b362df
Parents:
79b6596
Message:

Now all the filesystem tree stuff is done in a script.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r79b6596 rc2dbca8  
    532532            return True
    533533
     534
     535    def create_config_tree(self, src_dir, dest_dir, script):
     536        """
     537        Append commands to script that will create the directory hierarchy on
     538        the remote federant.
     539        """
     540
     541        if os.path.isdir(src_dir):
     542            print >>script, "mkdir -p %s" % dest_dir
     543            print >>script, "chmod 770 %s" % dest_dir
     544
     545            for f in os.listdir(src_dir):
     546                if os.path.isdir(f):
     547                    self.create_config_tree("%s/%s" % (src_dir, f),
     548                            "%s/%s" % (dest_dir, f), script)
     549        else:
     550            self.log.debug("[create_config_tree]: Not a directory: %s" \
     551                    % src_dir)
     552
    534553    def ship_configs(self, host, user, src_dir, dest_dir):
    535554        """
    536555        Copy federant-specific configuration files to the federant.
    537556        """
    538         if not self.ssh_cmd(user, host, "mkdir -p %s" % dest_dir):
    539             return False
    540         if not self.ssh_cmd(user, host, "chmod 770 %s" % dest_dir):
    541             return False
    542 
    543557        for f in os.listdir(src_dir):
    544558            if os.path.isdir(f):
     
    571585            dev_null = open("/dev/null", "a")
    572586        except IOError, e:
    573             self.log.error("[start_segment]: can't open /dev/null: %s" %e)
     587            self.log.error("[get_state]: can't open /dev/null: %s" %e)
    574588
    575589        if self.debug:
     
    670684            print >>scriptfile, "mkdir -p %s" % d
    671685        print >>scriptfile, 'mkdir -p %s' % proj_dir
     686        self.create_config_tree("%s/%s" % (tmpdir, tb), proj_dir, scriptfile)
     687        if os.path.isdir("%s/tarfiles" % tmpdir):
     688            self.create_config_tree("%s/tarfiles" % tmpdir, tarfiles_dir,
     689                    scriptfile)
     690        if os.path.isdir("%s/rpms" % tmpdir):
     691            self.create_config_tree("%s/rpms" % tmpdir, rpms_dir,
     692                    scriptfile)
    672693        print >>scriptfile, "rm -f %s" % scriptbase
    673694        scriptfile.close()
Note: See TracChangeset for help on using the changeset viewer.