self.root renamed to self.url
Change-Id: I7b59b4b6490bea76038ba55d571f9f9a9ae43fa5
diff --git a/rsync_remote.py b/rsync_remote.py
index d7c6194..f3fd751 100644
--- a/rsync_remote.py
+++ b/rsync_remote.py
@@ -19,7 +19,7 @@
self.logger = utils.logger.getChild('RsyncRemote.' + rsync_url)
self.tmp = TempFiles()
self.shell = Shell(self.logger)
- self.root = RsyncUrl(rsync_url)
+ self.url = RsyncUrl(rsync_url)
self.rsync_extra_params = rsync_extra_params
def _do_rsync(self, source='', dest=None, opts='', extra=None):
@@ -35,7 +35,7 @@
# TODO: check for url compatibility (local->remote, remote->local,
# local->local)
# TODO: push method - upstream mirrors
- dest = self.root.urljoin(dest)
+ dest = self.url.urljoin(dest)
allextra = self.rsync_extra_params
if extra is not None:
allextra = ' '.join((allextra, extra))
@@ -76,16 +76,16 @@
'''Removes file on rsync_url.'''
report_name = filename
dirname, filename = os.path.split(filename)
- dirname = self.root.dirname(dirname)
- source = self.root.dirname(self.tmp.empty_dir)
+ dirname = self.url.dirname(dirname)
+ source = self.url.dirname(self.tmp.empty_dir)
opts = "-r --delete --include={} '--exclude=*'".format(filename)
self.logger.info('Removing file "{}"'.format(report_name))
return self._do_rsync(source=source, dest=dirname, opts=opts)
def cleandir(self, dirname):
'''Removes directories (recursive) on rsync_url'''
- dirname = self.root.dirname(dirname)
- source = self.root.dirname(self.tmp.empty_dir)
+ dirname = self.url.dirname(dirname)
+ source = self.url.dirname(self.tmp.empty_dir)
opts = "-a --delete"
self.logger.info('Cleaning directory "{}"'.format(dirname))
return self._do_rsync(source=source, dest=dirname, opts=opts)
@@ -94,11 +94,11 @@
'''Removes directories (recursive) on rsync_url'''
self.logger.info('Removing directory "{}"'.format(dirname))
self.cleandir(dirname)
- return self.rmfile(self.root.filename(dirname))
+ return self.rmfile(self.url.filename(dirname))
def mkdir(self, dirname):
'''Creates directories (recirsive, like mkdir -p) on rsync_url'''
- source = self.root.dirname(self.tmp.get_temp_dir(dirname))
+ source = self.url.dirname(self.tmp.get_temp_dir(dirname))
opts = "-a"
self.logger.info('Creating directory "{}"'.format(dirname))
return self._do_rsync(source=source, opts=opts)
@@ -106,7 +106,7 @@
def symlink(self, symlink, target):
'''Creates symlink targeted to target'''
source = self.tmp.get_symlink_to(target)
- symlink = self.root.filename(symlink)
+ symlink = self.url.filename(symlink)
opts = "-l"
self.rmfile(symlink)
self.logger.info('Creating symlink "{}" -> "{}"'
diff --git a/rsync_versioned.py b/rsync_versioned.py
index b67280c..c288201 100644
--- a/rsync_versioned.py
+++ b/rsync_versioned.py
@@ -38,7 +38,7 @@
self.logger = utils.logger.getChild('RsyncVersioned.' + rsync_url)
self.timestamp = TimeStamp()
self.logger.info('Using timestamp {}'.format(self.timestamp))
- self.snapshot_dir = self.root.dirname(snapshot_dir)
+ self.snapshot_dir = self.url.dirname(snapshot_dir)
self.latest_successful_postfix = latest_successful_postfix
self.save_latest_days = save_latest_days
@@ -58,15 +58,15 @@
pass
def push(self, source, repo_name, extra=None):
- latest_path = self.root.filename(
+ latest_path = self.url.filename(
self.snapshot_dir,
- '{}-{}'.format(self.root.filename(repo_name),
+ '{}-{}'.format(self.url.filename(repo_name),
self.latest_successful_postfix)
)
- snapshot_name = self.root.filename(
- '{}-{}'.format(self.root.filename(repo_name), self.timestamp)
+ snapshot_name = self.url.filename(
+ '{}-{}'.format(self.url.filename(repo_name), self.timestamp)
)
- repo_path = self.root.filename(self.snapshot_dir, snapshot_name)
+ repo_path = self.url.filename(self.snapshot_dir, snapshot_name)
# TODO: check --link-dest !!!!
# FILESROOT=fwm/files