From mboxrd@z Thu Jan 1 00:00:00 1970 From: rmccabe@sourceware.org Date: 10 Aug 2007 18:36:31 -0000 Subject: [Cluster-devel] conga/luci/utils luci_admin Message-ID: <20070810183631.27181.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: conga Changes by: rmccabe at sourceware.org 2007-08-10 18:36:31 Modified files: luci/utils : luci_admin Log message: - backup returns -1, not 0 on failure. - do not warn about not being about to chown/chmod nonexistent backups Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/utils/luci_admin.diff?cvsroot=cluster&r1=1.54&r2=1.55 --- conga/luci/utils/luci_admin 2007/08/07 20:22:54 1.54 +++ conga/luci/utils/luci_admin 2007/08/10 18:36:31 1.55 @@ -161,12 +161,17 @@ os.chmod(LUCI_DB_PATH, 0600) for ext in [ '.tmp', '.old', '.index', '.lock' ]: cur_path = '%s%s' % (LUCI_DB_PATH, ext) + try: os.chown(cur_path, uid, gid) os.chmod(cur_path, 0600) + except OSError, eieio: + if eieio[0] != 2: + sys.stderr.write('Unable to change ownership of "%s" back to user "%s": %s\n' \ + % (cur_path, LUCI_USER, str(eieio))) except Exception, ei: - sys.stderr.write('Unable to change ownership of "%s" to user "%s": %s\n' \ - % (cur_path, LUCI_USER, str(ei))) + sys.stderr.write('Unable to change ownership of "%s" to user "%s": %s %r\n' \ + % (cur_path, LUCI_USER, str(ei), ei)) except Exception, e: sys.stderr.write('Unable to change ownership of the Luci database "%s" back to user "%s": %s\n' \ % (LUCI_DB_PATH, LUCI_USER, str(e))) @@ -1140,7 +1145,7 @@ doc = luci_backup(argv[2:]) restore_luci_db_fsattr() - if not doc: + if doc == -1: sys.stderr.write('The Luci backup failed. Exiting.\n') sys.exit(1)