Commit 26087a86 authored by cpomies's avatar cpomies
Browse files

Minor changes

Changed name of RsyncArtifact in RsyncManager
Source and Destination in RsyncManager begin non-option
parent 162a9b06
......@@ -5,12 +5,12 @@ function get_config_file {
exit 1
fi
SOURCES="${RSYNC_DIR}"
SOURCE="${RSYNC_DIR}"
if [ -d "${RSYNC_WORKDIR}" ] ; then
SOURCES="${RSYNC_WORKDIR}"
SOURCE="${RSYNC_WORKDIR}"
fi
lbn-manage-rsync --verbose --get-config --source "${SOURCES}" --destination "${ARTIFACTS_DIR}"
lbn-manage-rsync --verbose --get-config "${SOURCE}" "${ARTIFACTS_DIR}"
if [ -e ${ARTIFACTS_DIR}/${slot}.json ] ; then
export config_file=${ARTIFACTS_DIR}/${slot}.json
......
......@@ -5,7 +5,7 @@ function get_sources {
exit 1
fi
lbn-manage-rsync --verbose --get-sources --source "${RSYNC_DIR}" --destination "${ARTIFACTS_DIR}"
lbn-manage-rsync --verbose --get-sources "${RSYNC_DIR}" "${ARTIFACTS_DIR}"
export GET_SOURCES="true"
......
......@@ -5,6 +5,6 @@ function push_artifact {
exit 1
fi
lbn-manage-rsync --verbose --source "${ARTIFACTS_DIR}" --destination "${RSYNC_DIR}"
lbn-manage-rsync --verbose "${ARTIFACTS_DIR}" "${RSYNC_DIR}"
}
......@@ -27,7 +27,7 @@ import json
from LbNightlyTools import Configuration
from LbNightlyTools.Utils import timeout_call as call, ensureDirs, pack, setenv
from LbNightlyTools.Utils import Dashboard
from RsyncArtifact import execute_rsync
from LbNightlyTools.RsyncManager import execute_rsync
from string import Template
from socket import gethostname
......
......@@ -52,7 +52,7 @@ def execute_rsync(src, dest, includes = [], excludes = [], extra_param = []):
class Script(LbUtils.Script.PlainScript):
__usage__ = '%prog [options]'
__usage__ = '%prog [options] source destination'
__version__ = ''
def defineOpts(self):
......@@ -71,19 +71,6 @@ class Script(LbUtils.Script.PlainScript):
action='store_true',
dest='get_sources',
help='Synchronize sources files')
'''
self.parser.add_option('--progress',
action='store_true',
dest='progress',
help='Shows progress during rsync')
'''
self.parser.add_option('-d', '--destination',
action='store',
help='Destination folder')
self.parser.add_option('-s', '--source',
action='store',
help='Source folder')
self.parser.set_defaults(get_config=False,
get_sources=False,
......@@ -92,18 +79,13 @@ class Script(LbUtils.Script.PlainScript):
def main(self):
if len(self.args) != 0:
if len(self.args) != 2:
self.parser.error('wrong number of arguments')
opts = self.options
if not opts.source:
self.log.error("Source folder needs to be defined with -s or --source")
return 1
if not opts.destination:
self.log.error("Destination folder needs to be defined with -d or --destination")
return 1
source = self.args[0]
destination = self.args[1]
includes_param = []
excludes_param = []
......@@ -122,8 +104,8 @@ class Script(LbUtils.Script.PlainScript):
extra_param = ['--progress']
return execute_rsync(
opts.source,
opts.destination,
source,
destination,
includes_param,
excludes_param,
extra_param)
......@@ -12,6 +12,6 @@
import LbUtils.Log
LbUtils.Log._default_log_format = '%(asctime)s:' + LbUtils.Log._default_log_format
from LbNightlyTools.RsyncArtifact import Script
from LbNightlyTools.RsyncManager import Script
import sys
sys.exit(Script().run())
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment