cedar-backup-svn Mailing List for Cedar Backup (Page 11)
Brought to you by:
pronovic
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(50) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
|
Feb
(5) |
Mar
(55) |
Apr
(13) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(5) |
Nov
(3) |
Dec
(3) |
| 2009 |
Jan
|
Feb
|
Mar
(11) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(14) |
Feb
(2) |
Mar
|
Apr
|
May
(7) |
Jun
(8) |
Jul
(30) |
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(48) |
Nov
(1) |
Dec
|
| 2015 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pro...@us...> - 2008-03-16 23:34:31
|
Revision: 852
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=852&view=rev
Author: pronovic
Date: 2008-03-16 16:34:19 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
Fix stage action so it works for local users (closes: #1854634).
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/peer.py
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-03-16 23:20:35 UTC (rev 851)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-03-16 23:34:19 UTC (rev 852)
@@ -116,8 +116,14 @@
continue
logger.debug("Found collect indicator.")
targetDir = stagingDirs[peer.name]
- ownership = getUidGid(config.options.backupUser, config.options.backupGroup)
- logger.debug("Using target dir [%s], ownership [%d:%d]." % (targetDir, ownership[0], ownership[1]))
+ if os.getuid() == 0:
+ # Since we're running as root, we can change ownership
+ ownership = getUidGid(config.options.backupUser, config.options.backupGroup)
+ logger.debug("Using target dir [%s], ownership [%d:%d]." % (targetDir, ownership[0], ownership[1]))
+ else:
+ # Non-root cannot change ownership, so don't set it
+ ownership = None
+ logger.debug("Using target dir [%s], ownership [None]." % targetDir)
try:
count = peer.stagePeer(targetDir=targetDir, ownership=ownership) # note: utilize effective user's default umask
logger.info("Staged %d files for peer [%s]." % (count, peer.name))
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 23:20:35 UTC (rev 851)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 23:34:19 UTC (rev 852)
@@ -981,14 +981,11 @@
differenceSet = afterSet.difference(beforeSet) # files we added as part of copy
if len(differenceSet) == 0:
raise IOError("Apparently did not copy any new files from remote peer.")
- if localUser is None:
- logger.debug("Not root, so not attempting to change owner on staged files.")
- else:
- for targetFile in differenceSet:
- if ownership is not None:
- os.chown(targetFile, ownership[0], ownership[1])
- if permissions is not None:
- os.chmod(targetFile, permissions)
+ for targetFile in differenceSet:
+ if ownership is not None:
+ os.chown(targetFile, ownership[0], ownership[1])
+ if permissions is not None:
+ os.chmod(targetFile, permissions)
return len(differenceSet)
_copyRemoteDir = staticmethod(_copyRemoteDir)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-03-16 23:20:39
|
Revision: 851
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=851&view=rev
Author: pronovic
Date: 2008-03-16 16:20:35 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
Fix stage action so it works for local users (closes: #1854634).
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/actions/stage.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/actions/stage.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-03-16 22:03:24 UTC (rev 850)
+++ cedar-backup2/trunk/CedarBackup2/actions/stage.py 2008-03-16 23:20:35 UTC (rev 851)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -248,9 +248,10 @@
if configPeers is not None:
for peer in configPeers:
remoteUser = _getRemoteUser(config, peer)
+ localUser = _getLocalUser(config)
rcpCommand = _getRcpCommand(config, peer)
remotePeer = RemotePeer(peer.name, peer.collectDir, config.options.workingDir,
- remoteUser, rcpCommand, config.options.backupUser)
+ remoteUser, rcpCommand, localUser)
remotePeers.append(remotePeer)
logger.debug("Found remote peer: [%s]" % remotePeer.name)
return remotePeers
@@ -273,6 +274,21 @@
return remotePeer.remoteUser
+###########################
+# _getLocalUser() function
+###########################
+
+def _getLocalUser(config):
+ """
+ Gets the remote user associated with a remote peer.
+ @param config: Config object.
+ @return: Name of local user that should be used
+ """
+ if os.getuid() != 0:
+ return None
+ return config.options.backupUser
+
+
############################
# _getRcpCommand() function
############################
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 22:03:24 UTC (rev 850)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 23:20:35 UTC (rev 851)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -784,10 +784,8 @@
sourceFile, targetFile,
overwrite=False)
if os.path.exists(targetFile):
- logger.debug("Found collect indicator.")
return True
else:
- logger.debug("Did not find collect indicator.")
return False
except Exception, e:
logger.info("Failed looking for collect indicator: %s" % e)
@@ -976,18 +974,21 @@
command = resolveCommand(rcpCommandList)
result = executeCommand(command, [copySource, targetDir])[0]
if result != 0:
- raise IOError("Error (%d) copying files from remote host (using no local user)." % result)
+ raise IOError("Error (%d) copying files from remote host." % result)
afterSet = RemotePeer._getDirContents(targetDir)
if len(afterSet) == 0:
raise IOError("Did not copy any files from remote peer.")
differenceSet = afterSet.difference(beforeSet) # files we added as part of copy
if len(differenceSet) == 0:
raise IOError("Apparently did not copy any new files from remote peer.")
- for targetFile in differenceSet:
- if ownership is not None:
- os.chown(targetFile, ownership[0], ownership[1])
- if permissions is not None:
- os.chmod(targetFile, permissions)
+ if localUser is None:
+ logger.debug("Not root, so not attempting to change owner on staged files.")
+ else:
+ for targetFile in differenceSet:
+ if ownership is not None:
+ os.chown(targetFile, ownership[0], ownership[1])
+ if permissions is not None:
+ os.chmod(targetFile, permissions)
return len(differenceSet)
_copyRemoteDir = staticmethod(_copyRemoteDir)
@@ -1069,7 +1070,7 @@
command = resolveCommand(rcpCommandList)
result = executeCommand(command, [copySource, targetFile])[0]
if result != 0:
- raise IOError("Error (%d) copying [%s] from remote host (using no local user)." % (result, sourceFile))
+ raise IOError("Error (%d) copying [%s] from remote host." % (result, sourceFile))
if not os.path.exists(targetFile):
raise IOError("Apparently unable to copy file from remote host.")
if ownership is not None:
@@ -1140,7 +1141,7 @@
command = resolveCommand(rcpCommandList)
result = executeCommand(command, [sourceFile.replace(" ", "\\ "), copyTarget])[0]
if result != 0:
- raise IOError("Error (%d) copying [%s] to remote host (using no local user)." % (result, sourceFile))
+ raise IOError("Error (%d) copying [%s] to remote host." % (result, sourceFile))
_pushLocalFile = staticmethod(_pushLocalFile)
def _executeRemoteCommand(remoteUser, localUser, remoteHost, rshCommand, rshCommandList, remoteCommand):
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-03-16 22:03:24 UTC (rev 850)
+++ cedar-backup2/trunk/Changelog 2008-03-16 23:20:35 UTC (rev 851)
@@ -3,6 +3,7 @@
* Fix testEncodePath_009() to be aware of "UTF-8" encoding.
* Fix typos in the PostgreSQL extension section of the manual.
* Improve logging when stage action fails (closes: #1854635).
+ * Fix stage action so it works for local users (closes: #1854634).
Version 2.15.2 07 Feb 2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-03-16 22:04:05
|
Revision: 850
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=850&view=rev
Author: pronovic
Date: 2008-03-16 15:03:24 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
Improve logging when stage action fails (closes: #1854635)
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 21:44:04 UTC (rev 849)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2008-03-16 22:03:24 UTC (rev 850)
@@ -784,10 +784,13 @@
sourceFile, targetFile,
overwrite=False)
if os.path.exists(targetFile):
+ logger.debug("Found collect indicator.")
return True
else:
+ logger.debug("Did not find collect indicator.")
return False
- except:
+ except Exception, e:
+ logger.info("Failed looking for collect indicator: %s" % e)
return False
finally:
if os.path.exists(targetFile):
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-03-16 21:44:04 UTC (rev 849)
+++ cedar-backup2/trunk/Changelog 2008-03-16 22:03:24 UTC (rev 850)
@@ -2,6 +2,7 @@
* Fix testEncodePath_009() to be aware of "UTF-8" encoding.
* Fix typos in the PostgreSQL extension section of the manual.
+ * Improve logging when stage action fails (closes: #1854635).
Version 2.15.2 07 Feb 2008
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-03-16 21:45:12
|
Revision: 849
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=849&view=rev
Author: pronovic
Date: 2008-03-16 14:44:04 -0700 (Sun, 16 Mar 2008)
Log Message:
-----------
Fix typos in the PostgreSQL extension section of the manual.
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/manual/src/extensions.xml
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-02-27 04:05:21 UTC (rev 848)
+++ cedar-backup2/trunk/Changelog 2008-03-16 21:44:04 UTC (rev 849)
@@ -1,6 +1,7 @@
Version 2.15.3 unreleased
* Fix testEncodePath_009() to be aware of "UTF-8" encoding.
+ * Fix typos in the PostgreSQL extension section of the manual.
Version 2.15.2 07 Feb 2008
Modified: cedar-backup2/trunk/manual/src/extensions.xml
===================================================================
--- cedar-backup2/trunk/manual/src/extensions.xml 2008-02-27 04:05:21 UTC (rev 848)
+++ cedar-backup2/trunk/manual/src/extensions.xml 2008-03-16 21:44:04 UTC (rev 849)
@@ -798,11 +798,11 @@
</para>
<programlisting>
-<mysql>
+<postgresql>
<compress_mode>bzip2</compress_mode>
<user>username</user>
<all>Y</all>
-</mysql>
+</postgresql>
</programlisting>
<para>
@@ -811,13 +811,13 @@
</para>
<programlisting>
-<mysql>
+<postgresql>
<compress_mode>bzip2</compress_mode>
<user>username</user>
<all>N</all>
<database>db1</database>
<database>db2</database>
-</mysql>
+</postgresql>
</programlisting>
<para>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-02-27 04:15:24
|
Revision: 848
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=848&view=rev
Author: pronovic
Date: 2008-02-26 20:05:21 -0800 (Tue, 26 Feb 2008)
Log Message:
-----------
Fix testEncodePath_009() to be aware of UTF-8 encoding.
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/utiltests.py
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-02-07 15:25:31 UTC (rev 847)
+++ cedar-backup2/trunk/Changelog 2008-02-27 04:05:21 UTC (rev 848)
@@ -1,3 +1,7 @@
+Version 2.15.3 unreleased
+
+ * Fix testEncodePath_009() to be aware of "UTF-8" encoding.
+
Version 2.15.2 07 Feb 2008
* Updated copyright statements now that code changed in year 2008.
Modified: cedar-backup2/trunk/test/utiltests.py
===================================================================
--- cedar-backup2/trunk/test/utiltests.py 2008-02-07 15:25:31 UTC (rev 847)
+++ cedar-backup2/trunk/test/utiltests.py 2008-02-27 04:05:21 UTC (rev 848)
@@ -3273,7 +3273,7 @@
path = u"\xe2\x99\xaa\xe2\x99\xac"
safePath = encodePath(path)
self.failUnless(isinstance(safePath, str))
- if encoding == "utf-8":
+ if encoding.upper() == "UTF-8": # apparently, some platforms have "utf-8", some have "UTF-8"
self.failUnlessEqual('\xc3\xa2\xc2\x99\xc2\xaa\xc3\xa2\xc2\x99\xc2\xac', safePath)
else:
self.failUnlessEqual("\xe2\x99\xaa\xe2\x99\xac", safePath)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-02-07 15:25:35
|
Revision: 847
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=847&view=rev
Author: pronovic
Date: 2008-02-07 07:25:31 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Release 2.15.2
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2008-02-07 15:23:54 UTC (rev 846)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2008-02-07 15:25:31 UTC (rev 847)
@@ -33,8 +33,8 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
-COPYRIGHT = "2004-2007"
-VERSION = "2.15.1"
-DATE = "19 Dec 2007"
+COPYRIGHT = "2004-2008"
+VERSION = "2.15.2"
+DATE = "07 Feb 2008"
URL = "http://cedar-solutions.com/software/cedar-backup"
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-02-07 15:23:54 UTC (rev 846)
+++ cedar-backup2/trunk/Changelog 2008-02-07 15:25:31 UTC (rev 847)
@@ -5,10 +5,6 @@
- Add new function testtutil.hexFloatLiteralAllowed()
- Fix splittests.TestByteQuantity.testConstructor_004() for 0xAC
- Fix configtests.TestBlankBehavior.testConstructor_006() for 0xAC
- - Octal and hex notations apply only to integer literals. However,
- Python apparently didn't enforce this before 2.5. These tests
- actually did their job, which was to make me aware of the change.
- This was a test-only bug, and there was no functional impact.
Version 2.15.1 19 Dec 2007
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-02-07 15:23:58
|
Revision: 846
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=846&view=rev
Author: pronovic
Date: 2008-02-07 07:23:54 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Update copyright statements for year 2008
Modified Paths:
--------------
cedar-backup2/trunk/CREDITS
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CREDITS
===================================================================
--- cedar-backup2/trunk/CREDITS 2008-02-07 15:21:36 UTC (rev 845)
+++ cedar-backup2/trunk/CREDITS 2008-02-07 15:23:54 UTC (rev 846)
@@ -23,7 +23,7 @@
software, as indicated in the source code itself.
Unless otherwise indicated, all Cedar Backup source code is copyright
-(c) 2004-2007 Kenneth J. Pronovici and is released under the GNU General
+(c) 2004-2008 Kenneth J. Pronovici and is released under the GNU General
Public License. The contents of the GNU General Public License can be
found in the LICENSE file, or can be downloaded from http://www.gnu.org/.
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-02-07 15:21:36 UTC (rev 845)
+++ cedar-backup2/trunk/Changelog 2008-02-07 15:23:54 UTC (rev 846)
@@ -1,5 +1,6 @@
-Version 2.15.2 07 Feb 2007
+Version 2.15.2 07 Feb 2008
+ * Updated copyright statements now that code changed in year 2008.
* Fix two unit test failures when using Python 2.5 (SF #1861878).
- Add new function testtutil.hexFloatLiteralAllowed()
- Fix splittests.TestByteQuantity.testConstructor_004() for 0xAC
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-02-07 15:21:42
|
Revision: 845
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=845&view=rev
Author: pronovic
Date: 2008-02-07 07:21:36 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Fix SF bug #1861878
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/testutil.py
cedar-backup2/trunk/Changelog
cedar-backup2/trunk/test/configtests.py
cedar-backup2/trunk/test/splittests.py
Modified: cedar-backup2/trunk/CedarBackup2/testutil.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/testutil.py 2008-02-07 15:21:17 UTC (rev 844)
+++ cedar-backup2/trunk/CedarBackup2/testutil.py 2008-02-07 15:21:36 UTC (rev 845)
@@ -8,7 +8,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2006 Kenneth J. Pronovici.
+# Copyright (c) 2004-2006,2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -482,3 +482,28 @@
locales.append(line.rstrip())
return locales
+
+####################################
+# hexFloatLiteralAllowed() function
+####################################
+
+def hexFloatLiteralAllowed():
+ """
+ Indicates whether hex float literals are allowed by the interpreter.
+
+ As far back as 2004, some Python documentation indicated that octal and hex
+ notation applies only to integer literals. However, prior to Python 2.5, it
+ was legal to construct a float with an argument like 0xAC. This check
+ provides a version-based indication of whether the current interpreter
+ supports that behavior.
+
+ This check exists so that unit tests can continue to test the same thing as
+ always for pre-2.5 interpreters (i.e. making sure backwards compatibility
+ doesn't break) while still continuing to work for later interpreters.
+
+ The returned value is True for Python <= 2.5, and False otherwise.
+ """
+ if map(int, [sys.version_info[0], sys.version_info[1]]) < [2, 5]:
+ return True
+ return False
+
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2008-02-07 15:21:17 UTC (rev 844)
+++ cedar-backup2/trunk/Changelog 2008-02-07 15:21:36 UTC (rev 845)
@@ -1,3 +1,14 @@
+Version 2.15.2 07 Feb 2007
+
+ * Fix two unit test failures when using Python 2.5 (SF #1861878).
+ - Add new function testtutil.hexFloatLiteralAllowed()
+ - Fix splittests.TestByteQuantity.testConstructor_004() for 0xAC
+ - Fix configtests.TestBlankBehavior.testConstructor_006() for 0xAC
+ - Octal and hex notations apply only to integer literals. However,
+ Python apparently didn't enforce this before 2.5. These tests
+ actually did their job, which was to make me aware of the change.
+ This was a test-only bug, and there was no functional impact.
+
Version 2.15.1 19 Dec 2007
* Improve error reporting for managed client action failures.
Modified: cedar-backup2/trunk/test/configtests.py
===================================================================
--- cedar-backup2/trunk/test/configtests.py 2008-02-07 15:21:17 UTC (rev 844)
+++ cedar-backup2/trunk/test/configtests.py 2008-02-07 15:21:36 UTC (rev 845)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2004-2007 Kenneth J. Pronovici.
+# Copyright (c) 2004-2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -102,6 +102,7 @@
import os
import unittest
from CedarBackup2.testutil import findResources, removedir, failUnlessAssignRaises
+from CedarBackup2.testutil import hexFloatLiteralAllowed
from CedarBackup2.config import ActionHook, PreActionHook, PostActionHook, CommandOverride
from CedarBackup2.config import ExtendedAction, ActionDependencies, BlankBehavior
from CedarBackup2.config import CollectFile, CollectDir, PurgeDir, LocalPeer, RemotePeer
@@ -1084,8 +1085,10 @@
self.failUnlessEqual("1E6", behavior.blankFactor)
behavior.blankFactor = "0.25E2"
self.failUnlessEqual("0.25E2", behavior.blankFactor)
- behavior.blankFactor = "0xAC"
- self.failUnlessEqual("0xAC", behavior.blankFactor)
+ if hexFloatLiteralAllowed():
+ # Some interpreters allow this, some don't
+ behavior.blankFactor = "0xAC"
+ self.failUnlessEqual("0xAC", behavior.blankFactor)
def testConstructor_007(self):
"""
Modified: cedar-backup2/trunk/test/splittests.py
===================================================================
--- cedar-backup2/trunk/test/splittests.py 2008-02-07 15:21:17 UTC (rev 844)
+++ cedar-backup2/trunk/test/splittests.py 2008-02-07 15:21:36 UTC (rev 845)
@@ -9,7 +9,7 @@
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
-# Copyright (c) 2007 Kenneth J. Pronovici.
+# Copyright (c) 2007-2008 Kenneth J. Pronovici.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or
@@ -111,6 +111,7 @@
from CedarBackup2.util import UNIT_BYTES, UNIT_KBYTES, UNIT_MBYTES, UNIT_GBYTES
from CedarBackup2.testutil import findResources, buildPath, removedir, extractTar
from CedarBackup2.testutil import failUnlessAssignRaises, platformSupportsLinks, availableLocales
+from CedarBackup2.testutil import hexFloatLiteralAllowed
from CedarBackup2.xmlutil import createOutputDom, serializeDom
from CedarBackup2.extend.split import LocalConfig, SplitConfig, ByteQuantity
from CedarBackup2.extend.split import _splitFile, _splitDailyDir
@@ -221,8 +222,10 @@
self.failUnlessEqual("1E6", quantity.quantity)
quantity.quantity = "0.25E2"
self.failUnlessEqual("0.25E2", quantity.quantity)
- quantity.quantity = "0xAC"
- self.failUnlessEqual("0xAC", quantity.quantity)
+ if hexFloatLiteralAllowed():
+ # Some interpreters allow this, some don't
+ quantity.quantity = "0xAC"
+ self.failUnlessEqual("0xAC", quantity.quantity)
def testConstructor_005(self):
"""
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2008-02-07 15:21:22
|
Revision: 844
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=844&view=rev
Author: pronovic
Date: 2008-02-07 07:21:17 -0800 (Thu, 07 Feb 2008)
Log Message:
-----------
Add docdist to distrib rule
Modified Paths:
--------------
cedar-backup2/trunk/Makefile
Modified: cedar-backup2/trunk/Makefile
===================================================================
--- cedar-backup2/trunk/Makefile 2007-12-20 04:21:46 UTC (rev 843)
+++ cedar-backup2/trunk/Makefile 2008-02-07 15:21:17 UTC (rev 844)
@@ -160,7 +160,7 @@
# Debian packages are maintained via cvs-buildpackage as usual). This
# keeps cedar-backup2 from being a Debian-native package.
-distrib: debdist
+distrib: debdist docdist
distribclean: sdistclean debdistclean
-@$(RM) -f MANIFEST
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 04:21:53
|
Revision: 843
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=843&view=rev
Author: pronovic
Date: 2007-12-19 20:21:46 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Fix ksh vs. bash typo
Modified Paths:
--------------
cedar-backup2/trunk/manual/src/securingssh.xml
Modified: cedar-backup2/trunk/manual/src/securingssh.xml
===================================================================
--- cedar-backup2/trunk/manual/src/securingssh.xml 2007-12-20 03:28:14 UTC (rev 842)
+++ cedar-backup2/trunk/manual/src/securingssh.xml 2007-12-20 04:21:46 UTC (rev 843)
@@ -158,7 +158,7 @@
</para>
<screen>
-#!/bin/ksh
+#!/bin/bash
if [[ "${SSH_ORIGINAL_COMMAND}" == "ls -l" ]] ; then
${SSH_ORIGINAL_COMMAND}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 03:28:16
|
Revision: 842
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=842&view=rev
Author: pronovic
Date: 2007-12-19 19:28:14 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Tagging the 2.15.1 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.15.1/
Copied: cedar-backup2/tags/CEDAR_BACKUP2_V2.15.1 (from rev 841, cedar-backup2/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 03:28:07
|
Revision: 841
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=841&view=rev
Author: pronovic
Date: 2007-12-19 19:28:02 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Release 2.15.1
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/release.py
Modified: cedar-backup2/trunk/CedarBackup2/release.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/release.py 2007-12-20 03:27:39 UTC (rev 840)
+++ cedar-backup2/trunk/CedarBackup2/release.py 2007-12-20 03:28:02 UTC (rev 841)
@@ -34,7 +34,7 @@
AUTHOR = "Kenneth J. Pronovici"
EMAIL = "pro...@ie..."
COPYRIGHT = "2004-2007"
-VERSION = "2.15.0"
-DATE = "18 Dec 2007"
+VERSION = "2.15.1"
+DATE = "19 Dec 2007"
URL = "http://cedar-solutions.com/software/cedar-backup"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 03:27:40
|
Revision: 840
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=840&view=rev
Author: pronovic
Date: 2007-12-19 19:27:39 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add appendix on securing password-less SSH connections
Modified Paths:
--------------
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2007-12-20 03:27:04 UTC (rev 839)
+++ cedar-backup2/trunk/Changelog 2007-12-20 03:27:39 UTC (rev 840)
@@ -2,6 +2,7 @@
* Improve error reporting for managed client action failures.
* Make sure that managed client failure does not kill entire backup.
+ * Add appendix "Securing Password-less SSH Connection" to user manual.
Version 2.15.0 18 Dec 2007
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 03:27:06
|
Revision: 839
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=839&view=rev
Author: pronovic
Date: 2007-12-19 19:27:04 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add appendix on securing password-less SSH connections
Modified Paths:
--------------
cedar-backup2/trunk/manual/src/book.xml
cedar-backup2/trunk/manual/src/commandline.xml
cedar-backup2/trunk/manual/src/config.xml
cedar-backup2/trunk/manual/src/depends.xml
cedar-backup2/trunk/manual/src/preface.xml
cedar-backup2/trunk/manual/src/recovering.xml
Added Paths:
-----------
cedar-backup2/trunk/manual/src/securingssh.xml
Property Changed:
----------------
cedar-backup2/trunk/manual/src/commandline.xml
cedar-backup2/trunk/manual/src/depends.xml
cedar-backup2/trunk/manual/src/recovering.xml
Modified: cedar-backup2/trunk/manual/src/book.xml
===================================================================
--- cedar-backup2/trunk/manual/src/book.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/book.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -45,6 +45,7 @@
<!ENTITY extenspec SYSTEM "extenspec.xml">
<!ENTITY depends SYSTEM "depends.xml">
<!ENTITY recovering SYSTEM "recovering.xml">
+<!ENTITY securingssh SYSTEM "securingssh.xml">
<!ENTITY copyright SYSTEM "copyright.xml">
]>
@@ -118,6 +119,7 @@
&extenspec;
&depends;
&recovering;
+ &securingssh;
©right;
</book>
Modified: cedar-backup2/trunk/manual/src/commandline.xml
===================================================================
--- cedar-backup2/trunk/manual/src/commandline.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/commandline.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -26,7 +26,7 @@
# Author : Kenneth J. Pronovici <pro...@ie...>
# Language : O'Reilly DocBook Lite XML DTD
# Project : Cedar Backup, release 2
-# Revision : $Id: config.xml 1110 2007-02-17 19:46:23Z pronovic $
+# Revision : $Id$
# Purpose : Cedar Backup software manual, commandline chapter.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Property changes on: cedar-backup2/trunk/manual/src/commandline.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: cedar-backup2/trunk/manual/src/config.xml
===================================================================
--- cedar-backup2/trunk/manual/src/config.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/config.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -3102,6 +3102,14 @@
unless otherwise indicated.
</para>
+ <note>
+ <para>
+ See <xref linkend="cedar-securingssh"/> for some important notes on
+ how to optionally further secure password-less SSH connections to
+ your clients.
+ </para>
+ </note>
+
<!-- ################################################################# -->
<sect2>
Modified: cedar-backup2/trunk/manual/src/depends.xml
===================================================================
--- cedar-backup2/trunk/manual/src/depends.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/depends.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -26,7 +26,7 @@
# Author : Kenneth J. Pronovici <pro...@ie...>
# Language : O'Reilly DocBook Lite XML DTD
# Project : Cedar Backup, release 2
-# Revision : $Id: appendixb.xml 568 2005-02-08 23:08:25Z pronovic $
+# Revision : $Id$
# Purpose : Cedar Backup Software Manual, dependencies appendix.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Property changes on: cedar-backup2/trunk/manual/src/depends.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: cedar-backup2/trunk/manual/src/preface.xml
===================================================================
--- cedar-backup2/trunk/manual/src/preface.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/preface.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -245,6 +245,19 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><xref linkend="cedar-securingssh"/></term>
+ <listitem>
+ <para>
+ Password-less SSH connections are a necessary evil when
+ remote backup processes need to execute without human
+ interaction. This appendix describes some ways that you can
+ reduce the risk to your backup pool should your master
+ machine be compromised.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</sect1>
Modified: cedar-backup2/trunk/manual/src/recovering.xml
===================================================================
--- cedar-backup2/trunk/manual/src/recovering.xml 2007-12-20 01:42:31 UTC (rev 838)
+++ cedar-backup2/trunk/manual/src/recovering.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -26,7 +26,7 @@
# Author : Kenneth J. Pronovici <pro...@ie...>
# Language : O'Reilly DocBook Lite XML DTD
# Project : Cedar Backup, release 2
-# Revision : $Id: extenspec.xml 739 2005-03-29 23:00:55Z pronovic $
+# Revision : $Id$
# Purpose : Cedar Backup Software Manual, recovering appendix.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Property changes on: cedar-backup2/trunk/manual/src/recovering.xml
___________________________________________________________________
Name: svn:keywords
+ Id
Added: cedar-backup2/trunk/manual/src/securingssh.xml
===================================================================
--- cedar-backup2/trunk/manual/src/securingssh.xml (rev 0)
+++ cedar-backup2/trunk/manual/src/securingssh.xml 2007-12-20 03:27:04 UTC (rev 839)
@@ -0,0 +1,249 @@
+<!--
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# C E D A R
+# S O L U T I O N S "Software done right."
+# S O F T W A R E
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Copyright (c) 2007 Kenneth J. Pronovici.
+# All rights reserved.
+#
+# This work is free; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License, Version 2,
+# as published by the Free Software Foundation.
+#
+# This work 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.
+#
+# Copies of the GNU General Public License are available from
+# the Free Software Foundation website, http://www.gnu.org/.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+#
+# Author : Kenneth J. Pronovici <pro...@ie...>
+# Language : O'Reilly DocBook Lite XML DTD
+# Project : Cedar Backup, release 2
+# Revision : $Id$
+# Purpose : Cedar Backup Software Manual, securing SSH appendix.
+#
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+-->
+
+<appendix id="cedar-securingssh">
+
+ <title>Securing Password-less SSH Connections</title>
+
+ <simplesect>
+
+ <para>
+ Cedar Backup relies on password-less public key SSH connections to
+ make various parts of its backup process work. Password-less
+ <command>scp</command> is used to stage files from remote clients to
+ the master, and password-less <command>ssh</command> is used to
+ execute actions on managed clients.
+ </para>
+
+ <para>
+ Normally, it is a good idea to avoid password-less SSH connections in
+ favor of using an SSH agent. The SSH agent manages your SSH
+ connections so that you don't need to type your passphrase over and
+ over. You get most of the benefits of a password-less connection
+ without the risk. Unfortunately, because Cedar Backup has to execute
+ without human involvement (through a cron job), use of an agent really
+ isn't feasable. We have to rely on true password-less public keys to
+ give the master access to the client peers.
+ </para>
+
+ <para>
+ Traditionally, Cedar Backup has relied on a <quote>segmenting</quote>
+ strategy to minimize the risk. Although the backup typically runs as
+ root — so that all parts of the filesystem can be backed up
+ — we don't use the root user for network connections. Instead,
+ we use a dedicated backup user on the master to initiate network
+ connections, and dedicated users on each of the remote peers to accept
+ network connections.
+ </para>
+
+ <para>
+ With this strategy in place, an attacker with access to the backup
+ user on the master (or even root access, really) can at best only get
+ access to the backup user on the remote peers. We still concede a
+ local attack vector, but at least that vector is restricted to an
+ unprivileged user.
+ </para>
+
+ <para>
+ Some Cedar Backup users may not be comfortable with this risk, and
+ others may not be able to implement the segmentation strategy —
+ they simply may not have a way to create a login which is only used
+ for backups.
+ </para>
+
+ <para>
+ So, what are these users to do? Fortunately there is a solution.
+ The SSH authorized keys file supports a way to put a <quote>filter</quote>
+ in place on an SSH connection. This excerpt is from the AUTHORIZED_KEYS FILE FORMAT
+ section of man 8 sshd:
+ </para>
+
+ <screen>
+command="command"
+ Specifies that the command is executed whenever this key is used for
+ authentication. The command supplied by the user (if any) is ignored. The
+ command is run on a pty if the client requests a pty; otherwise it is run
+ without a tty. If an 8-bit clean channel is required, one must not request
+ a pty or should specify no-pty. A quote may be included in the command by
+ quoting it with a backslash. This option might be useful to restrict
+ certain public keys to perform just a specific operation. An example might
+ be a key that permits remote backups but nothing else. Note that the client
+ may specify TCP and/or X11 forwarding unless they are explicitly prohibited.
+ Note that this option applies to shell, command or subsystem execution.
+ </screen>
+
+ <para>
+ Essentially, this gives us a way to authenticate the commands that are
+ being executed. We can either accept or reject commands, and we can
+ even provide a readable error message for commands we reject. The
+ filter is applied on the remote peer, to the key that provides the
+ master access to the remote peer.
+ </para>
+
+ <para>
+ So, let's imagine that we have two hosts: master
+ <quote>mickey</quote>, and peer <quote>minnie</quote>. Here is the
+ original <filename>~/.ssh/authorized_keys</filename> file for the
+ backup user on minnie (remember, this is all on one line in the file):
+ </para>
+
+ <screen>
+ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxw7EnqVULBFgPcut3WYp3MsSpVB9q9iZ+awek120391k;mm0c221=3=km
+=m=askdalkS82mlF7SusBTcXiCk1BGsg7axZ2sclgK+FfWV1Jm0/I9yo9FtAZ9U+MmpL901231asdkl;ai1-923ma9s=9=
+1-2341=-a0sd=-sa0=1z= backup@mickey
+ </screen>
+
+ <para>
+ This line is the public key that minnie can use to identify the backup
+ user on mickey. Assuming that there is no passphrase on the private
+ key back on mickey, the backup user on mickey can get direct access to
+ minnie.
+ </para>
+
+ <para>
+ To put the filter in place, we add a command option to the key,
+ like this:
+ </para>
+
+ <screen>
+command="/opt/backup/validate-backup" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxw7EnqVULBFgPcut3WYp
+3MsSpVB9q9iZ+awek120391k;mm0c221=3=km=m=askdalkS82mlF7SusBTcXiCk1BGsg7axZ2sclgK+FfWV1Jm0/I9yo9F
+tAZ9U+MmpL901231asdkl;ai1-923ma9s=9=1-2341=-a0sd=-sa0=1z= backup@mickey
+ </screen>
+
+ <para>
+ Basically, the command option says that whenever this key is used
+ to successfully initiate a connection, the
+ <command>/opt/backup/validate-backup</command> command will be run
+ <emphasis>instead of</emphasis> the real command that came over the
+ SSH connection. Fortunately, the interface gives the command access
+ to certain shell variables that can be used to invoke the original
+ command if you want to.
+ </para>
+
+ <para>
+ A very basic <command>validate-backup</command> script might look
+ something like this:
+ </para>
+
+ <screen>
+#!/bin/ksh
+if [[ "${SSH_ORIGINAL_COMMAND}" == "ls -l" ]] ; then
+ ${SSH_ORIGINAL_COMMAND}
+else
+ echo "Security policy does not allow command [${SSH_ORIGINAL_COMMAND}]."
+ exit 1
+fi
+ </screen>
+
+ <para>
+ This script allows exactly <command>ls -l</command> and nothing else.
+ If the user attempts some other command, they get a nice error message
+ telling them that their command has been disallowed.
+ </para>
+
+ <para>
+ For remote commands executed over <command>ssh</command>, the original
+ command is exactly what the caller attempted to invoke. For remote
+ copies, the commands are either <command>scp -f file</command> (copy
+ <emphasis>from</emphasis> the peer to the master) or <command>scp -t
+ file</command> (copy <emphasis>to</emphasis> the peer from the
+ master).
+ </para>
+
+ <para>
+ If you want, you can see what command SSH thinks it is executing by
+ using <command>ssh -v</command> or <command>scp -v</command>. The
+ command will be right at the top, something like this:
+ </para>
+
+ <screen>
+Executing: program /usr/bin/ssh host mickey, user (unspecified), command scp -v -f .profile
+OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006
+debug1: Reading configuration data /home/backup/.ssh/config
+debug1: Applying options for daystrom
+debug1: Reading configuration data /etc/ssh/ssh_config
+debug1: Applying options for *
+debug2: ssh_connect: needpriv 0
+ </screen>
+
+ <para>
+ Omit the <command>-v</command> and you have your command: <command>scp
+ -f .profile</command>.
+ </para>
+
+ <para>
+ For a normal, non-managed setup, you need to allow the following
+ commands, where <filename>/path/to/collect/</filename> is replaced
+ with the real path to the collect directory on the remote peer:
+ </para>
+
+ <screen>
+scp -f /path/to/collect/cback.collect
+scp -f /path/to/collect/*
+scp -t /path/to/collect/cback.stage
+ </screen>
+
+ <para>
+ If you are configuring a managed client, then you also need to list
+ the exact command lines that the master will be invoking on the
+ managed client. You are guaranteed that the master will invoke one
+ action at a time, so if you list two lines per action (full and
+ non-full) you should be fine. Here's an example for the collect
+ action:
+ </para>
+
+ <screen>
+/usr/bin/cback --full collect
+/usr/bin/cback collect
+ </screen>
+
+ <para>
+ Of course, you would have to list the actual path to the
+ <command>cback</command> executable — exactly the one listed in
+ the <cback_command> configuration option for your managed peer.
+ </para>
+
+ <para>
+ I hope that there is enough information here for interested users to
+ implement something that makes them comfortable. I have resisted
+ providing a complete example script, because I think everyone's setup
+ will be different. However, feel free to write if you are working
+ through this and you have questions.
+ </para>
+
+ </simplesect>
+
+</appendix>
+
Property changes on: cedar-backup2/trunk/manual/src/securingssh.xml
___________________________________________________________________
Name: svn:keywords
+ Id
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-20 01:42:33
|
Revision: 838
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=838&view=rev
Author: pronovic
Date: 2007-12-19 17:42:31 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Improve managed action error handling
Modified Paths:
--------------
cedar-backup2/trunk/CedarBackup2/cli.py
cedar-backup2/trunk/CedarBackup2/peer.py
cedar-backup2/trunk/Changelog
Modified: cedar-backup2/trunk/CedarBackup2/cli.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/cli.py 2007-12-19 16:17:27 UTC (rev 837)
+++ cedar-backup2/trunk/CedarBackup2/cli.py 2007-12-20 01:42:31 UTC (rev 838)
@@ -448,9 +448,14 @@
"""
Executes the managed action associated with an item.
- @note: Only options.full is actually used. The rest of
- the arguments exist to satisfy the ActionItem iterface.
+ @note: Only options.full is actually used. The rest of the arguments
+ exist to satisfy the ActionItem iterface.
+ @note: Errors here result in a message logged to ERROR, but no thrown
+ exception. The analogy is the stage action where a problem with one host
+ should not kill the entire backup. Since we're logging an error, the
+ administrator will get an email.
+
@param configPath: Path to configuration file on disk.
@param options: Command-line options to be passed to action.
@param config: Parsed configuration to be passed to action.
@@ -459,7 +464,10 @@
"""
for peer in self.remotePeers:
logger.debug("Executing managed action [%s] on peer [%s]." % (self.name, peer.name))
- peer.executeManagedAction(self.name, options.full)
+ try:
+ peer.executeManagedAction(self.name, options.full)
+ except IOError, e:
+ logger.error(e) # log the message and go on, so we don't kill the backup
###################
Modified: cedar-backup2/trunk/CedarBackup2/peer.py
===================================================================
--- cedar-backup2/trunk/CedarBackup2/peer.py 2007-12-19 16:17:27 UTC (rev 837)
+++ cedar-backup2/trunk/CedarBackup2/peer.py 2007-12-20 01:42:31 UTC (rev 838)
@@ -857,8 +857,12 @@
@raise IOError: If there is an error executing the action on the remote peer.
"""
- command = RemotePeer._buildCbackCommand(self.cbackCommand, action, fullBackup)
- self.executeRemoteCommand(command)
+ try:
+ command = RemotePeer._buildCbackCommand(self.cbackCommand, action, fullBackup)
+ self.executeRemoteCommand(command)
+ except IOError, e:
+ logger.info(e)
+ raise IOError("Failed to execute action [%s] on managed client [%s]." % (action, self.name))
##################
@@ -1160,21 +1164,21 @@
@raise IOError: If there is an error executing the remote command
"""
+ actualCommand = "%s %s@%s '%s'" % (rshCommand, remoteUser, remoteHost, remoteCommand)
if localUser is not None:
try:
if os.getuid() != 0:
raise IOError("Only root can remote shell as another user.")
except AttributeError: pass
command = resolveCommand(SU_COMMAND)
- actualCommand = "%s %s@%s '%s'" % (rshCommand, remoteUser, remoteHost, remoteCommand)
result = executeCommand(command, [localUser, "-c", actualCommand])[0]
if result != 0:
- raise IOError("Error (%d) executing command on remote host as local user [%s]." % (result, localUser))
+ raise IOError("Command failed [su -c %s \"%s\"]" % (localUser, actualCommand))
else:
command = resolveCommand(rshCommandList)
result = executeCommand(command, ["%s@%s" % (remoteUser, remoteHost), "%s" % remoteCommand])[0]
if result != 0:
- raise IOError("Error (%d) executing command on remote host (using no local user)." % result)
+ raise IOError("Command failed [%s]" % (actualCommand))
_executeRemoteCommand = staticmethod(_executeRemoteCommand)
def _buildCbackCommand(cbackCommand, action, fullBackup):
Modified: cedar-backup2/trunk/Changelog
===================================================================
--- cedar-backup2/trunk/Changelog 2007-12-19 16:17:27 UTC (rev 837)
+++ cedar-backup2/trunk/Changelog 2007-12-20 01:42:31 UTC (rev 838)
@@ -1,3 +1,8 @@
+Version 2.15.1 19 Dec 2007
+
+ * Improve error reporting for managed client action failures.
+ * Make sure that managed client failure does not kill entire backup.
+
Version 2.15.0 18 Dec 2007
* Minor documentation tweaks discovered during 3.0 development.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 16:17:30
|
Revision: 837
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=837&view=rev
Author: pronovic
Date: 2007-12-19 08:17:27 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add svn:ignore configs
Property Changed:
----------------
web/trunk/cedar-backup/source/
Property changes on: web/trunk/cedar-backup/source
___________________________________________________________________
Name: svn:ignore
+ *.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 16:16:23
|
Revision: 836
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=836&view=rev
Author: pronovic
Date: 2007-12-19 08:16:22 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add svn:ignore configs
Property Changed:
----------------
web/trunk/cedar-backup/
Property changes on: web/trunk/cedar-backup
___________________________________________________________________
Name: svn:ignore
+ content.tar
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 16:13:47
|
Revision: 835
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=835&view=rev
Author: pronovic
Date: 2007-12-19 08:13:46 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add svn:ignore configs
Property Changed:
----------------
web/trunk/cedar-backup/
web/trunk/cedar-backup/source/
Property changes on: web/trunk/cedar-backup
___________________________________________________________________
Name: sgn:ignore
+ content.tar
Property changes on: web/trunk/cedar-backup/source
___________________________________________________________________
Name: sgn:ignore
+ .*.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 16:13:27
|
Revision: 834
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=834&view=rev
Author: pronovic
Date: 2007-12-19 08:13:18 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
Add user manual to sidebar
Modified Paths:
--------------
web/trunk/cedar-backup/GTMLMakefile
web/trunk/cedar-backup/Makefile
web/trunk/cedar-backup/config/footer.gth
web/trunk/cedar-backup/config/site-wide.gth
Modified: web/trunk/cedar-backup/GTMLMakefile
===================================================================
--- web/trunk/cedar-backup/GTMLMakefile 2007-12-19 04:31:44 UTC (rev 833)
+++ web/trunk/cedar-backup/GTMLMakefile 2007-12-19 16:13:18 UTC (rev 834)
@@ -11,9 +11,9 @@
##############
OUTPUT_FILES = \
+ source/gpl.html \
source/index.html \
- source/terms.html \
- source/gpl.html
+ source/terms.html
#####################
# Processsing rules #
@@ -35,10 +35,10 @@
# File dependencies #
#####################
+source/index.gtml: /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/site-wide.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_footer.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/footer.gth
+ touch $@
/home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/header.gth: /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/copyright.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/copyright.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/copyright.gth
touch $@
-source/index.gtml: /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/site-wide.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_footer.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/footer.gth
- touch $@
source/gpl.gtml: /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/site-wide.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_header.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/content_footer.gth /home/users/p/pr/pronovic/projects/dev/web/cedar-backup/config/footer.gth
touch $@
source/index.html: project.gtp source/index.gtml
Modified: web/trunk/cedar-backup/Makefile
===================================================================
--- web/trunk/cedar-backup/Makefile 2007-12-19 04:31:44 UTC (rev 833)
+++ web/trunk/cedar-backup/Makefile 2007-12-19 16:13:18 UTC (rev 834)
@@ -53,7 +53,7 @@
cp $(TARBALL) $(CACHE) && \
cd $(TARGET) && \
tar -xf $(CACHE)/$(TARBALL) && \
- rm $(CACHE)/$(TARBALL) && \
+ rm -f $(CACHE)/$(TARBALL) && \
echo "Deployment complete."
distclean: allclean
Modified: web/trunk/cedar-backup/config/footer.gth
===================================================================
--- web/trunk/cedar-backup/config/footer.gth 2007-12-19 04:31:44 UTC (rev 833)
+++ web/trunk/cedar-backup/config/footer.gth 2007-12-19 16:13:18 UTC (rev 834)
@@ -10,6 +10,7 @@
<h3><span>Navigation</span></h3>
<ul>
<li><a href="<<HOME_URL>>" accesskey="h">Cedar Backup <span class="accesskey">H</span>ome</a></li>
+ <li><a href="<<V2_MANUAL_URL>>"accesskey="u">Software <span class="accesskey">U</span>ser Manual</a></li>
<li><a href="<<SF_PROJECT_URL>>"accesskey="p">SF <span class="accesskey">P</span>roject Page</a></li>
<li><a href="<<SF_DOWNLOADS_URL>>"accesskey="d">SF <span class="accesskey">D</span>ownloads</a></li>
<li><a href="<<SF_LISTS_URL>>"accesskey="l">SF Mailing <span class="accesskey">L</span>ists</a></li>
Modified: web/trunk/cedar-backup/config/site-wide.gth
===================================================================
--- web/trunk/cedar-backup/config/site-wide.gth 2007-12-19 04:31:44 UTC (rev 833)
+++ web/trunk/cedar-backup/config/site-wide.gth 2007-12-19 16:13:18 UTC (rev 834)
@@ -24,6 +24,8 @@
#define SF_CODE_URL https://sourceforge.net/svn/?group_id=210468
#define SF_SVN_BROWSE_URL http://cedar-backup.svn.sourceforge.net/viewvc/cedar-backup/
+#define V2_MANUAL_URL <<V2_DOC_DIR_URL>>/manual/index.html
+
#define CEDAR_URL http://cedar-solutions.com
#define CEDAR_DEBIAN_URL <<CEDAR_URL>>/debian.html
#define DEBIAN_URL http://debian.org/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:31:45
|
Revision: 833
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=833&view=rev
Author: pronovic
Date: 2007-12-18 20:31:44 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Tagging the 2.15.0 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.15.0/
Copied: cedar-backup2/tags/CEDAR_BACKUP2_V2.15.0 (from rev 832, cedar-backup2/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:31:40
|
Revision: 832
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=832&view=rev
Author: pronovic
Date: 2007-12-18 20:31:39 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Tagging new version of 2.15.0 release of Cedar Backup.
Removed Paths:
-------------
cedar-backup2/tags/CEDAR_BACKUP2_V2.15.0/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:31:22
|
Revision: 831
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=831&view=rev
Author: pronovic
Date: 2007-12-18 20:31:20 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Fix screw-up in sdist rule
Modified Paths:
--------------
cedar-backup3/trunk/Makefile
Modified: cedar-backup3/trunk/Makefile
===================================================================
--- cedar-backup3/trunk/Makefile 2007-12-19 04:30:45 UTC (rev 830)
+++ cedar-backup3/trunk/Makefile 2007-12-19 04:31:20 UTC (rev 831)
@@ -165,7 +165,7 @@
-@$(RM) -f MANIFEST
-@$(RM) -rf $(DIST_DIR)
-sdist: $(SDIST_DIR)
+sdist: $(SDIST_DIR) doc
@$(SETUP) sdist --dist-dir $(SDIST_DIR)
@$(CP) $(SDIST_DIR)/CedarBackup3-$(VERSION).tar.gz ../
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:30:52
|
Revision: 830
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=830&view=rev
Author: pronovic
Date: 2007-12-18 20:30:45 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Better fix to document-building problem
Modified Paths:
--------------
cedar-backup2/trunk/Makefile
Modified: cedar-backup2/trunk/Makefile
===================================================================
--- cedar-backup2/trunk/Makefile 2007-12-19 04:26:16 UTC (rev 829)
+++ cedar-backup2/trunk/Makefile 2007-12-19 04:30:45 UTC (rev 830)
@@ -166,7 +166,7 @@
-@$(RM) -f MANIFEST
-@$(RM) -rf $(DIST_DIR)
-sdist: $(SDIST_DIR) docdist
+sdist: $(SDIST_DIR) doc
@$(SETUP) sdist --dist-dir $(SDIST_DIR)
@$(CP) $(SDIST_DIR)/CedarBackup2-$(VERSION).tar.gz ../
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:26:22
|
Revision: 829
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=829&view=rev
Author: pronovic
Date: 2007-12-18 20:26:16 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Fix screw-up in sdist rule
Modified Paths:
--------------
cedar-backup2/trunk/Makefile
Modified: cedar-backup2/trunk/Makefile
===================================================================
--- cedar-backup2/trunk/Makefile 2007-12-19 04:09:56 UTC (rev 828)
+++ cedar-backup2/trunk/Makefile 2007-12-19 04:26:16 UTC (rev 829)
@@ -160,13 +160,13 @@
# Debian packages are maintained via cvs-buildpackage as usual). This
# keeps cedar-backup2 from being a Debian-native package.
-distrib: debdist docdist
+distrib: debdist
distribclean: sdistclean debdistclean
-@$(RM) -f MANIFEST
-@$(RM) -rf $(DIST_DIR)
-sdist: $(SDIST_DIR)
+sdist: $(SDIST_DIR) docdist
@$(SETUP) sdist --dist-dir $(SDIST_DIR)
@$(CP) $(SDIST_DIR)/CedarBackup2-$(VERSION).tar.gz ../
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pro...@us...> - 2007-12-19 04:09:59
|
Revision: 828
http://cedar-backup.svn.sourceforge.net/cedar-backup/?rev=828&view=rev
Author: pronovic
Date: 2007-12-18 20:09:56 -0800 (Tue, 18 Dec 2007)
Log Message:
-----------
Tagging the 2.15.0 release of Cedar Backup.
Added Paths:
-----------
cedar-backup2/tags/CEDAR_BACKUP2_V2.15.0/
Copied: cedar-backup2/tags/CEDAR_BACKUP2_V2.15.0 (from rev 827, cedar-backup2/trunk)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|