[elbe-devel] [PATCH 2/2] initvmaction: Add sync action
Torben Hohn
torben.hohn at linutronix.de
Wed Jun 3 11:09:40 CEST 2020
On Mon, May 25, 2020 at 02:49:11PM -0400, Olivier Dion wrote:
> The initvm sync command will synchronize the local repository with the
> initvm. This does not check if there's a build in progress nor if the
> files are okay. The elbe-daemon _could crash silently_.
>
> We're excluding Git stuffs, Python bytecodes and caches, Elbe' builds,
> default initvm, examples and documentations.
>
> Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
> ---
> elbepack/initvmaction.py | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
> index c6c1943f..9eb1aa8f 100644
> --- a/elbepack/initvmaction.py
> +++ b/elbepack/initvmaction.py
> @@ -628,3 +628,21 @@ class SubmitAction(InitVMAction):
>
> submit_and_dl_result(xmlfile, cdrom, opt)
>
> + at InitVMAction.register('sync')
> +class SyncAction(InitVMAction):
> +
> + def __init__(self, node):
> + super(SyncAction, self).__init__(node)
> +
> + def execute(self, _initvmdir, opt, args):
> + top_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
> + try:
> + system("rsync --info=name1,stats1 --archive --times "
> + "--exclude='.git*' --exclude='*.pyc' --exclude='elbe-build*' "
> + "--exclude='initvm' --exclude='__pycache__' --exclude='docs' "
> + "--exclude='examples' "
> + "--rsh='ssh -p %s' --chown=root:root "
> + "%s/ root at localhost:/var/cache/elbe/devel" %
> + (cfg["sshport"], top_dir))
> + except CommandError as E:
> + print(E)
> --
> 2.26.2
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
More information about the elbe-devel
mailing list