diff options
author | Javier Jardón <jjardon@gnome.org> | 2017-11-26 23:39:48 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2017-12-12 15:58:23 +0000 |
commit | 7df7f3b427739ff7d69da2ba218da0124822892c (patch) | |
tree | 843c75e9bede53862ab101d6a7bcd1da15a33c55 /extensions/ssh-rsync.check | |
parent | 7aad5150f69da42b84994c353283db5daf8e967f (diff) | |
download | definitions-7df7f3b427739ff7d69da2ba218da0124822892c.tar.gz |
Remove all .morph files and files from the old format
Diffstat (limited to 'extensions/ssh-rsync.check')
-rwxr-xr-x | extensions/ssh-rsync.check | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/extensions/ssh-rsync.check b/extensions/ssh-rsync.check deleted file mode 100755 index 5c2e5507..00000000 --- a/extensions/ssh-rsync.check +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/python2 -# Copyright (C) 2014-2015 Codethink Limited -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. - -'''Preparatory checks for Morph 'ssh-rsync' write extension''' - - -import os - -import writeexts - - -class SshRsyncCheckExtension(writeexts.WriteExtension): - def process_args(self, args): - if len(args) != 1: - raise writeexts.ExtensionError( - 'Wrong number of command line args') - - upgrade = self.get_environment_boolean('UPGRADE') - if not upgrade: - raise writeexts.ExtensionError( - 'The ssh-rsync write is for upgrading existing remote ' - 'Baserock machines. It cannot be used for an initial ' - 'deployment.') - - if os.environ.get('VERSION_LABEL', '') == '': - raise writeexts.ExtensionError( - 'A VERSION_LABEL must be set when deploying an upgrade.') - - location = args[0] - self.check_ssh_connectivity(location) - self.check_is_baserock_system(location) - - # The new system that being deployed as an upgrade must contain - # baserock-system-config-sync and system-version-manager. However, the - # old system simply needs to have SSH and rsync. - self.check_command_exists(location, 'rsync') - - def check_is_baserock_system(self, location): - output = writeexts.ssh_runcmd( - location, - ['sh', '-c', 'test -d /baserock || echo -n dirnotfound']) - if output == 'dirnotfound': - raise writeexts.ExtensionError('%s is not a baserock system' - % location) - - def check_command_exists(self, location, command): - test = 'type %s > /dev/null 2>&1 || echo -n cmdnotfound' % command - output = writeexts.ssh_runcmd(location, ['sh', '-c', test]) - if output == 'cmdnotfound': - raise writeexts.ExtensionError( - "%s does not have %s" % (location, command)) - - -SshRsyncCheckExtension().run() |