diff options
author | Javier Jardón <jjardon@gnome.org> | 2016-10-12 08:24:16 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2016-10-12 08:24:35 +0000 |
commit | 36f7e4923ae5d03dd345d74f7fcade48c99a498d (patch) | |
tree | b4b91a6df40ca846422def1045fe20db464d7312 /extensions/ostree.check | |
parent | e3a0c6c3881728c0c1699ab1500fb1d3d488300c (diff) | |
download | definitions-36f7e4923ae5d03dd345d74f7fcade48c99a498d.tar.gz |
Revert "Add ostree.write deployment extension"
Deployment of the minimal system broke after applying this
This reverts commit 5bca5fc3e8215601d1e2d33ce31f6a41c4bcfcc9.
Change-Id: Ibbc7cd24e10adec207ccb9848985c301974dca6b
Diffstat (limited to 'extensions/ostree.check')
-rw-r--r-- | extensions/ostree.check | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/extensions/ostree.check b/extensions/ostree.check deleted file mode 100644 index e5fefe36..00000000 --- a/extensions/ostree.check +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/python -# Copyright (C) 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 Baserock 'ostree' write extension.''' - -from gi.repository import GLib -from gi.repository import Gio -from gi.repository import OSTree - -import logging -import os -import urlparse - -import writeexts - - -class OSTreeCheckExtension(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 upgrade: - raise writeexts.ExtensionError( - 'Use the `ssh-rsync` write extension to deploy upgrades to an ' - 'existing remote system.') - - location = args[0] - self.check_location(location) - - self.check_ostree_parameters() - - def check_location(self, location): - repo = OSTree.Repo.new(Gio.File.new_for_path(location)) - try: - repo.open() - except GLib.GError as e: - logging.debug("Error from OSTree: %s", e) - if 'No such file or directory' in e.message: - raise writeexts.ExtensionError( - "OSTree repo %s was not found." % location) - else: - raise writeexts.ExtensionError( - "Error opening OSTree repo %s: %s" % (location, e)) - - def check_ostree_parameters(self): - required = ['OSTREE_BRANCH', 'OSTREE_COMMIT_SUBJECT'] - for var in required: - if os.environ.get(var, '') == '': - raise writeexts.ExtensionError('%s was not given' % var) - - -OSTreeCheckExtension().run() |