From 007ab2c646c56600ed6701cf11e9a72bb402ad3e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Mon, 13 Dec 2010 23:48:52 +0100 Subject: Removed new features, too early to commit --- src/lib/Server/Admin/Examples.py | 71 ---------------------------------------- 1 file changed, 71 deletions(-) delete mode 100644 src/lib/Server/Admin/Examples.py (limited to 'src/lib/Server/Admin/Examples.py') diff --git a/src/lib/Server/Admin/Examples.py b/src/lib/Server/Admin/Examples.py deleted file mode 100644 index 3335c5e10..000000000 --- a/src/lib/Server/Admin/Examples.py +++ /dev/null @@ -1,71 +0,0 @@ -import dulwich -import time -import tarfile -from subprocess import Popen -import Bcfg2.Server.Admin -from Bcfg2.Server.Plugins.Metadata import MetadataConsistencyError - -class Examples(Bcfg2.Server.Admin.MetadataCore): - __shorthelp__ = "Pulls in the data from the Bcfg2 sample repository" - __longhelp__ = (__shorthelp__ + "\n\nbcfg2-admin examples pull\n" - "\n\nbcfg2-admin examples update\n" - "bcfg2-admin examples backup") - __usage__ = ("bcfg2-admin examples [options] [add|del|update|list] [attr=val]") - - def __init__(self, configfile): - Bcfg2.Server.Admin.MetadataCore.__init__(self, configfile, - self.__usage__) - - def __call__(self, args): - Bcfg2.Server.Admin.MetadataCore.__call__(self, args) - - - Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore) - Bcfg2.Server.Plugin.Version.__init__(self) - self.core = core - self.datastore = datastore - - if len(args) == 0: - self.errExit("No argument specified.\n" - "Please see bcfg2-admin examples help for usage.") - - if args[0] == 'pull': - try: - # FIXME: Repo URL is hardcoded for now - Popen(['git', 'clone', 'https://github.com/solj/bcfg2-repo.git', datastore]) - except MetadataConsistencyError: - print "Error in pulling examples." - raise SystemExit(1) - -#fatal: destination path 'bcfg2-test' already exists and is not an empty directory. - - elif args[0] == 'backup': - try: - self.metadata.add_group(args[1], attr_d) - except MetadataConsistencyError: - print "Error in adding group" - raise SystemExit(1) - - - elif args[0] == 'backup': - try: - self.metadata.add_group(args[1], attr_d) - except MetadataConsistencyError: - print "Error in adding group" - raise SystemExit(1) - - else: - print "No command specified" - raise SystemExit(1) - - def repobackup(): - """Make a backup of the existing files in the Bcfg2 repo directory.""" - if os.path.isdir(datastore): - print 'Backup in progress...' - target = time.strftime('%Y%m%d%H%M%S') - - - out = tarfile.open(filename, w.gz) - else: - logger.error("%s doesn't exist." % datastore) - #raise Bcfg2.Server.Plugin.PluginInitError -- cgit v1.2.3-1-g7c22