/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
DybPython::tar::Tar Class Reference

List of all members.

Public Member Functions

def __init__
def __repr__
def list
def members_
def names_
def examine
def digest
def archive
def moveaside
def extract
def transfer

Public Attributes

 path
 toplevelname
 mode
 remotepath
 remotenode
 confirm
 moveaside
 ALLOWCLOBBER
 names
 members
 prefix
 flattop

Static Public Attributes

tuple examine = timing(examine)
tuple archive = timing(archive)
tuple extract = timing(extract)
tuple transfer = timing(transfer)

Private Member Functions

def _folder_extract
def _check_clobber
def _flat_extract

Detailed Description

Definition at line 12 of file tar.py.


Constructor & Destructor Documentation

def DybPython::tar::Tar::__init__ (   self,
  path,
  toplevelname = "",
  mode = "gz",
  remoteprefix = "",
  remotenode = "C",
  confirm = True,
  moveaside = True,
  ALLOWCLOBBER = False 
)
:param path: to the tarball to be created, extracted or examined
:param toplevelname: relative to the sourcedir or extractdir, 

if a `toplevelname` is specified only members within that directory 
are tarballed or extracted

Hmm embedding the toplevel name withing the tarball, is not so flexible 
when want to test an extracted mysql DB tarball, would be more convenient to just flat 
archive the files. 

Definition at line 13 of file tar.py.

00014                                                                                                                                             :
00015         """
00016         :param path: to the tarball to be created, extracted or examined
00017         :param toplevelname: relative to the sourcedir or extractdir, 
00018 
00019         if a `toplevelname` is specified only members within that directory 
00020         are tarballed or extracted
00021 
00022         Hmm embedding the toplevel name withing the tarball, is not so flexible 
00023         when want to test an extracted mysql DB tarball, would be more convenient to just flat 
00024         archive the files. 
00025         """
00026         assert len(toplevelname) > 1, "as safety measure a non-blank toplevelname is required" 
00027         self.path = path 
00028         self.toplevelname = toplevelname
00029         self.mode = mode
00030         if len(remoteprefix)>0:
00031             remotepath = os.path.join(remoteprefix, path[1:])   # have to get rid of path leading slash for the join
00032         else:
00033             remotepath = path
00034         pass
00035         self.remotepath = remotepath
00036         self.remotenode = remotenode
00037         self.confirm = confirm 
00038         self.moveaside = moveaside
00039         self.ALLOWCLOBBER = ALLOWCLOBBER
00040         self.names = None
00041         self.members = None
00042         self.prefix = None
00043         self.flattop = None 


Member Function Documentation

def DybPython::tar::Tar::__repr__ (   self)

Definition at line 44 of file tar.py.

00045                       :
00046         return self.__class__.__name__ + " %s %s %s " % ( self.path, self.toplevelname, self.mode )
00047 
00048 

def DybPython::tar::Tar::list (   self,
  members,
  verbose = True 
)
Print a table of contents to sys.stdout. If `verbose' is False, only
   the names of the members are printed. If it is True, an `ls -l'-like
   output is produced.

Definition at line 49 of file tar.py.

00050                                          :
00051         """Print a table of contents to sys.stdout. If `verbose' is False, only
00052            the names of the members are printed. If it is True, an `ls -l'-like
00053            output is produced.
00054         """
00055         old_stdout = sys.stdout
00056         sys.stdout = mystdout = StringIO()
00057 
00058         for tarinfo in members:
00059             if verbose:
00060                 print tarfile.filemode(tarinfo.mode),
00061                 print "%s/%s" % (tarinfo.uname or tarinfo.uid,
00062                                  tarinfo.gname or tarinfo.gid),
00063                 if tarinfo.ischr() or tarinfo.isblk():
00064                     print "%10s" % ("%d,%d" \
00065                                     % (tarinfo.devmajor, tarinfo.devminor)),
00066                 else:
00067                     print "%10d" % tarinfo.size,
00068                 print "%d-%02d-%02d %02d:%02d:%02d" \
00069                       % time.localtime(tarinfo.mtime)[:6],
00070 
00071             print tarinfo.name,
00072 
00073             if verbose:
00074                 if tarinfo.issym():
00075                     print "->", tarinfo.linkname,
00076                 if tarinfo.islnk():
00077                     print "link to", tarinfo.linkname,
00078             print
00079             pass 
00080         sys.stdout = old_stdout
00081         return mystdout.getvalue()
00082 

def DybPython::tar::Tar::members_ (   self)
Caches the members list from tarballs into a sidecar `.pc` file
to avoid a 70s wait to access the members of a compressed tarball

http://userprimary.net/posts/2007/11/18/ctime-in-unix-means-last-change-time-not-create-time/

     ctime means change time

Definition at line 83 of file tar.py.

00084                       :
00085         """
00086         Caches the members list from tarballs into a sidecar `.pc` file
00087         to avoid a 70s wait to access the members of a compressed tarball
00088 
00089         http://userprimary.net/posts/2007/11/18/ctime-in-unix-means-last-change-time-not-create-time/
00090 
00091              ctime means change time
00092         """
00093         path = self.path
00094         mtime_ = lambda _:os.path.getmtime(_)
00095         ctime_ = lambda _:os.path.getctime(_)
00096         pc = "%s.pc" % path
00097         members = None
00098         if os.path.exists(pc):
00099             if ctime_(pc) > ctime_(path):
00100                 log.debug("load pickled members file %s " % pc )
00101                 members = pickle.load(file(pc,"r")) 
00102             else:
00103                 log.warn("pickled members exists but is outdated")
00104             pass
00105         pass 
00106         if not members:
00107             tf = tarfile.open(path, "r:gz")
00108             members = tf.getmembers() 
00109             pickle.dump( members, file(pc,"w")) 
00110             log.info("saving pickled members file: %s " % pc)
00111             tf.close() 
00112         pass
00113         return members

def DybPython::tar::Tar::names_ (   self)

Definition at line 114 of file tar.py.

00115                     :
00116         members = self.members_()
00117         self.members = members
00118         names = map(lambda ti:ti.name, members)
00119         return names

Definition at line 120 of file tar.py.

00121                      :
00122         assert os.path.exists(self.path), "path %s does not exist " % self.path 
00123         log.info("examining %s " % (self.path) )
00124         names = self.names_()
00125         prefix = os.path.commonprefix(names)
00126         flattop = prefix == ""
00127 
00128         log.info("archive contains %s items with commonprefix \"%s\" flattop %s " % ( len(names), prefix, flattop  ))
00129         log.debug("\n".join(names))
00130 
00131         self.names = names
00132         self.prefix = prefix
        self.flattop = flattop 
def DybPython::tar::Tar::digest (   self,
  verify = False 
)
Conditions: 

#. if sidecar does not exist then compute the digest and persist it.
#. if sidecar exists and `verify=False` then just read the 
   persisted dna and return it 
#. if sidecar exists and `verify=True` read the persited dna, compute it anew and 
   assert they are the same

DNA Verification is an appropriate check after transferring tarball and 
sidecar to another node.

The digest matches than obtained using `md5sum`::

    [blyth@belle7 DybPython]$ md5sum /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz
    2e0ec7c27ebc383adb6fa102f52ab6c0  /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz

Simple dictstring format is used to allow easy remote access::

    [blyth@belle7 DybPython]$ ssh H cat /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz.dna 
    {'dig': 'fa553838e97df686a4df116723ee59f7', 'size': 35360953}[blyth@belle7 DybPython]$ 

Definition at line 136 of file tar.py.

00137                                   :
00138         """
00139         Conditions: 
00140 
00141         #. if sidecar does not exist then compute the digest and persist it.
00142         #. if sidecar exists and `verify=False` then just read the 
00143            persisted dna and return it 
00144         #. if sidecar exists and `verify=True` read the persited dna, compute it anew and 
00145            assert they are the same
00146 
00147         DNA Verification is an appropriate check after transferring tarball and 
00148         sidecar to another node.
00149 
00150         The digest matches than obtained using `md5sum`::
00151 
00152             [blyth@belle7 DybPython]$ md5sum /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz
00153             2e0ec7c27ebc383adb6fa102f52ab6c0  /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz
00154 
00155         Simple dictstring format is used to allow easy remote access::
00156 
00157             [blyth@belle7 DybPython]$ ssh H cat /var/dbbackup/dbsrv/belle7.nuu.edu.tw/channelquality_db_belle7/10000_0.tar.gz.dna 
00158             {'dig': 'fa553838e97df686a4df116723ee59f7', 'size': 35360953}[blyth@belle7 DybPython]$ 
00159 
00160         """
00161         path = self.path
00162         assert os.path.exists(path), path
00163         sidecar = "%s.dna" % path
00164 
00165         # remove stale sidecars
00166         if os.path.exists(sidecar):
00167             if os.path.getctime(path) > os.path.getctime(sidecar): 
00168                 log.info("sidecar dna exists but is stale %s : removing it " % sidecar )
00169                 os.remove(sidecar)
00170             else:
00171                 log.info("sidecar dna exists %s and remains valid " % sidecar )
00172             pass
00173         pass
00174 
00175         if not os.path.exists(sidecar):
00176             dna = dnapath(path)
00177             file(sidecar,"w").write(repr(dna))
00178         else:
00179             sdna = file(sidecar,"r").read().strip()
00180             assert sdna[0] == '{' and sdna[-1] == '}', sdna
00181             dna = eval(sdna)
00182             log.debug("loaded dna from sidecar %s " % repr(dna))
00183             if verify:
00184                 rdna = dnapath(path)
00185                 log.info("rdna recomputed %s " % rdna )
00186                 assert dna == rdna, (dna, rdna) 
00187             pass
00188         pass
00189         log.debug("dna digest of the archive is %s " % repr(dna))
00190         return dna    
00191 

def DybPython::tar::Tar::archive (   self,
  sourcedir,
  deleteafter = False,
  flattop = False 
)
:param sourcedir: directory containing the `toplevelname` which will be the root of the archive 
:param deleteafter:
:param flattop:

Create the archive and examine::

   t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
   t.archive("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941")
   t.examine()

Examine what is in the archive:: 
    
   t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
   t.examine()

Under toplevelname `tmp_offline_db` within the archive when `flattop=False`::

    tmp_offline_db/
    tmp_offline_db/SupernovaTrigger.MYD
    tmp_offline_db/CalibPmtFineGainVld.frm
    tmp_offline_db/HardwareID.MYD
    ...

Under toplevelname `tmp_offline_db` within the archive when `flattop=True`::

    SupernovaTrigger.MYD
    CalibPmtFineGainVld.frm
    HardwareID.MYD
    ...
 
To reproduce the layout on another node would then need::

   t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
   t.extract("/tmp")  # creates /tmp/tmp_offline_db 

Definition at line 192 of file tar.py.

00193                                                                   :
00194         """
00195         :param sourcedir: directory containing the `toplevelname` which will be the root of the archive 
00196         :param deleteafter:
00197         :param flattop:
00198 
00199         Create the archive and examine::
00200 
00201            t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
00202            t.archive("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941")
00203            t.examine()
00204 
00205         Examine what is in the archive:: 
00206     
00207            t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
00208            t.examine()
00209 
00210         Under toplevelname `tmp_offline_db` within the archive when `flattop=False`::
00211 
00212             tmp_offline_db/
00213             tmp_offline_db/SupernovaTrigger.MYD
00214             tmp_offline_db/CalibPmtFineGainVld.frm
00215             tmp_offline_db/HardwareID.MYD
00216             ...
00217 
00218         Under toplevelname `tmp_offline_db` within the archive when `flattop=True`::
00219 
00220             SupernovaTrigger.MYD
00221             CalibPmtFineGainVld.frm
00222             HardwareID.MYD
00223             ...
00224  
00225         To reproduce the layout on another node would then need::
00226 
00227            t = Tar("/var/dbbackup/mysqlhotcopy/belle7.nuu.edu.tw/tmp_offline_db/20130515_1941.tar.gz", toplevelname="tmp_offline_db")
00228            t.extract("/tmp")  # creates /tmp/tmp_offline_db 
00229 
00230         """
00231         src = os.path.join(sourcedir, self.toplevelname) 
00232         assert len(self.toplevelname) > 3 , "sanity check for toplevelname %s fails" % self.toplevelname
00233         log.info("creating %s from %s " %  (self.path, src) )
00234         assert os.path.exists(src) and os.path.isdir(src), "src directory %s does not exist " % src
00235         tgz = tarfile.open(self.path, "w:%s" % self.mode )
00236         if flattop:
00237             arcname = ""
00238         else:
00239             arcname = self.toplevelname 
00240         pass
00241         tgz.add(src, arcname=arcname) 
00242         tgz.close() 
00243 
00244 
00245         datedfolder_ptn = re.compile("^\d{8}_\d{4}$") # eg 20130515_1941
00246         if deleteafter:
00247             leaf = sourcedir.split("/")[-1]
00248             if not datedfolder_ptn.match(leaf):
00249                 log.warn("NOT deleting sourcedir %s with leaf %s as the leaf is not a dated folder " % ( sourcedir, leaf ))
00250             else:
00251                 log.info("deleting sourcedir %s with leaf %s as the leaf is a dated folder " % ( sourcedir, leaf ))
00252                 if self.confirm:
00253                     confirm = raw_input("enter \"YES\" to confirm deletion of sourcedir %s :" % sourcedir )
00254                 else:
00255                     confirm = "YES"
00256                 pass 
00257                 if confirm == "YES":
00258                     shutil.rmtree(sourcedir)
00259                 else:
00260                     log.info("skipping deletion of %s " % sourcedir ) 
00261                 pass
00262         else:
            log.warn("not deleteing after")
def DybPython::tar::Tar::moveaside (   self,
  target,
  dryrun = False 
)

Definition at line 266 of file tar.py.

00267                                              :
00268         assert os.path.exists(target), target
00269         stamp = datetime.now().strftime("%Y%m%d_%H%M%S")
00270         aside = target + "_" + stamp
00271         msg = "moving aside pre-existing tgt dir %s to %s " % (target, aside) 
00272         assert not os.path.exists(aside), (aside, "huh the aside dir exists already ")
00273         if dryrun:
00274             log.info("dryrun : " + msg )
00275             return
00276         pass
00277         log.info(msg) 
00278         os.rename(target, aside)
00279 

def DybPython::tar::Tar::_folder_extract (   self,
  containerdir,
  toplevelname,
  dryrun = False 
) [private]
:param containerdir:
:param toplevelname:
:param dryrun:

Folder extraction takes all paths from the archive that are within 
a particular toplevelname within the archive and places then 
within the `containerdir/` folder. By virtue of the `toplevelname` 
paths within the archive the result will be 
`containerdir/toplevelname` folder in the filesystem.

This approach has the advantage of a non-exploding tarball, but is 
inconvenient for renaming. 

The `toplevelname` dir will be created by the extraction.

Definition at line 280 of file tar.py.

00281                                                                        :
00282         """  
00283         :param containerdir:
00284         :param toplevelname:
00285         :param dryrun:
00286 
00287         Folder extraction takes all paths from the archive that are within 
00288         a particular toplevelname within the archive and places then 
00289         within the `containerdir/` folder. By virtue of the `toplevelname` 
00290         paths within the archive the result will be 
00291         `containerdir/toplevelname` folder in the filesystem.
00292 
00293         This approach has the advantage of a non-exploding tarball, but is 
00294         inconvenient for renaming. 
00295 
00296         The `toplevelname` dir will be created by the extraction.
00297 
00298         """
00299         assert self.flattop is False , "_folder_extract requires non-flattop archive "
00300         assert self.toplevelname == toplevelname ,"_folder_extract requires default toplevelname %s %s " % (self.toplevelname, toplevelname)
00301         tf = tarfile.open(self.path, "r:gz")
00302         wtf = TarFileWrapper(tf)
00303         members = tf.getmembers()
00304 
00305         names = map(lambda tinfo:tinfo.name, members)
00306         log.info("_folder_extract names %s " % repr(names))
00307 
00308         #select_ = lambda tinfo:tinfo.name.split('/')[0] == toplevelname   # assumption of one level toplevelname incorrect for partitioned archives
00309         select_ = lambda tinfo:tinfo.name.startswith(toplevelname)
00310         select = filter(select_, members)
00311 
00312         assert len(members) == len(select), (len(members), len(select), "extraction filtering misses some members, toplevelname %s " % (toplevelname) ) 
00313         target = os.path.join(containerdir, toplevelname)
00314 
00315         if os.path.exists(target) and self.moveaside:
00316             self.moveaside(target, dryrun=dryrun)
00317         pass
00318 
00319         msg = "_folder_extract into containerdir %s for %s members with toplevelname %s  " % ( containerdir, len(members), toplevelname )
00320         if dryrun:
00321             log.info("dryrun: " + msg )
00322         else:
00323             log.info(msg)
00324             assert not os.path.exists(target), "target dir %s exists already, ABORTING EXTRACTION, use --moveaside option to rename it " % target
00325             wtf.extractall(containerdir, members) 
00326         pass
00327         tf.close() 
00328 

def DybPython::tar::Tar::_check_clobber (   self,
  target,
  members 
) [private]
:param target: directory in which the members are to be extracted
:param members: from the tarfile
:return: list of paths that would be clobberd by the extraction

Definition at line 329 of file tar.py.

00330                                               :
00331         """
00332         :param target: directory in which the members are to be extracted
00333         :param members: from the tarfile
00334         :return: list of paths that would be clobberd by the extraction
00335         """
00336         clobber = []
00337         fmt = "%-110s :  %s " 
00338         for member in members:
00339             name = member.name
00340             path = os.path.join(target, name)
00341             if os.path.exists(path):
00342                 if name == './':
00343                     log.warn(fmt % (name, "SKIP TOPDIR" ))
00344                 else:
00345                     clobber.append(name)
00346                     log.warn(fmt % (name, "**CLOBBER**" ))
00347             else:
00348                 log.debug(fmt % (name, "" ))
00349             pass
00350         pass
00351         return clobber
00352 

def DybPython::tar::Tar::_flat_extract (   self,
  containerdir,
  toplevelname,
  dryrun = False 
) [private]
:param containerdir:
:param toplevelname:
:param dryrun:

Flat extraction takes all paths from the archive and places
them within the `containerdir/toplevelname` folder 

The `toplevelname` dir must be created before the extraction.

Definition at line 353 of file tar.py.

00354                                                                      :
00355         """
00356         :param containerdir:
00357         :param toplevelname:
00358         :param dryrun:
00359 
00360         Flat extraction takes all paths from the archive and places
00361         them within the `containerdir/toplevelname` folder 
00362 
00363         The `toplevelname` dir must be created before the extraction.
00364 
00365         """
00366         assert self.flattop is True , "_flat_extract requires flattop archive "
00367         log.info("_flat_extract opening tarfile %s " % self.path )
00368         tf = tarfile.open(self.path, "r:gz")
00369         wtf = TarFileWrapper(tf)
00370         members = tf.getmembers()
00371         target = os.path.join(containerdir, toplevelname)
00372 
00373         clobber = self._check_clobber( target, members )
00374         if len(clobber) > 0:
00375             if not self.ALLOWCLOBBER:
00376                 log.warn("extraction would clobber %s existing paths, need `--ALLOWCLOBBER` option to do this : %s " % ( len(clobber), "\n".join(clobber) ))   
00377             else:
00378                 low.warn("proceeding to clobber %s existing paths curtesy of `--ALLOWCLOBBER` option : %s " %  ( len(clobber), "\n".join(clobber) )) 
00379         else:
00380             log.info("extraction into target %s does not clobber any existing paths " % target )   
00381 
00382 
00383         msg = "_flat_extract into target %s for %s members with toplevelname %s " % ( target, len(members),toplevelname )
00384         if dryrun:
00385             log.info("dryrun: " + msg )
00386         else:
00387             log.info(msg)
00388             if not self.ALLOWCLOBBER:
00389                 assert not os.path.exists(target), "target dir %s exists already, ABORTING EXTRACTION use --rename newname " % target 
00390             wtf.extractall(target, members) 
00391             pass 
00392             log.info( os.popen("ls -l %(target)s " % locals()).read() )
00393         pass
00394         tf.close() 
00395 
00396 

def DybPython::tar::Tar::extract (   self,
  containerdir,
  toplevelname = None,
  dryrun = False 
)
:param containerdir: folder within which the toplevelname dir resides
:param toplevelname: default of None corresponds to original db name
:param dryrun:

The actual extraction method depends on the type of archive detected:

#. `_flat_extract` for a flattop aka exploding archive 
#. `_folder_extract` for a folder top archive  

Flat extraction has the advantage of easy renaming  

Definition at line 397 of file tar.py.

00398                                                                     :
00399         """
00400         :param containerdir: folder within which the toplevelname dir resides
00401         :param toplevelname: default of None corresponds to original db name
00402         :param dryrun:
00403 
00404         The actual extraction method depends on the type of archive detected:
00405 
00406         #. `_flat_extract` for a flattop aka exploding archive 
00407         #. `_folder_extract` for a folder top archive  
00408 
00409         Flat extraction has the advantage of easy renaming  
00410         """
00411         
00412         if toplevelname is None:
00413             toplevelname = self.toplevelname
00414         pass
00415         log.info("extract containerdir %s toplevelname %s dryrun %s " % (containerdir, toplevelname, dryrun))
00416 
00417         assert os.path.exists(self.path), "path %s does not exist " % self.path 
00418         assert os.path.exists(containerdir), "containerdir %s does not exist" % containerdir
00419         assert not self.flattop is None, "ABORT must `examine` before can `extract` "
00420 
00421         if self.flattop:
00422              self._flat_extract(containerdir, toplevelname, dryrun=dryrun)
00423         else: 
00424              self._folder_extract(containerdir, toplevelname, dryrun=dryrun)
00425 
00426 

Prior to making expensive transfers of large tarballs the 
small local and remote DNA sidecar files are compared to see if the 
transfer can be skipped.

The use of `cheat=True` for the remote transfer means that the 
contents of the file are trusted to be true. Using `cheat=False` means that 
the digest is recomputed to obtain a new DNA. This can be timeconsuming for 
large files.

A good approach is to monitor the transfers on the receiving node by 
checking that recomputed DNA matches the sidecars.

Definition at line 429 of file tar.py.

00430                       :
00431         """
00432         Prior to making expensive transfers of large tarballs the 
00433         small local and remote DNA sidecar files are compared to see if the 
00434         transfer can be skipped.
00435 
00436         The use of `cheat=True` for the remote transfer means that the 
00437         contents of the file are trusted to be true. Using `cheat=False` means that 
00438         the digest is recomputed to obtain a new DNA. This can be timeconsuming for 
00439         large files.
00440 
00441         A good approach is to monitor the transfers on the receiving node by 
00442         checking that recomputed DNA matches the sidecars.
00443         """
00444         assert os.path.exists(self.path), "path %s does not exist " % self.path 
00445         assert os.path.exists(self.path + '.dna'), "dna path %s does not exist " % self.path + '.dna'
00446         ldna = sidecar_dna(self.path)
00447         assert not ldna is None
00448         rdna = remote_dna(self.remotepath, self.remotenode, cheat=True)  # when cheating assume the remote dna is valid
00449         log.debug("remote dna from %s:%s is %s " % ( self.remotenode, self.remotepath, repr(rdna)))
00450         if rdna == ldna:
00451             log.info("SKIP TRANSFER, remote dna of %s:%s matches local %s " % (self.remotenode,self.remotepath,ldna))
00452         else:
00453             log.info("remote dna %s differs from local %s for %s:%s proceed to  transfer" % (rdna, ldna, self.remotenode, self.remotepath))
00454             scp( self.path, self.remotepath, self.remotenode )
00455             scp( self.path, self.remotepath, self.remotenode, sidecar_ext='.dna')
        pass

Member Data Documentation

tuple DybPython::tar::Tar::examine = timing(examine) [static]

Definition at line 133 of file tar.py.

tuple DybPython::tar::Tar::archive = timing(archive) [static]

Definition at line 263 of file tar.py.

tuple DybPython::tar::Tar::extract = timing(extract) [static]

Definition at line 427 of file tar.py.

tuple DybPython::tar::Tar::transfer = timing(transfer) [static]

Definition at line 456 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.

Definition at line 23 of file tar.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:55:41 for DybPython by doxygen 1.7.4