Commit fd46a374 authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Merge branch 'stable-2.11' into stable-2.12

* stable-2.11
  (no changes)

* stable-2.10
  Adapt relative path expansion in PATH to new environment
  Exclude archived jobs from configuration backup
  Expose early_release for ReplaceInstanceDisks

* stable-2.9
  Make ganeti-cleaner switch to a save working directory
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarHelga Velroyen <>
parents a7ef9e77 0c53791a
......@@ -113,6 +113,9 @@ exec >>$LOG_FILE 2>&1
echo "Cleaner started at $(date)"
# Switch to a working directory accessible to the cleaner
# Remove old cleaner log files
find $CLEANER_LOG_DIR -maxdepth 1 -type f | sort | head -n -$KEEP_LOGS | \
xargs -r rm -vf
......@@ -1936,7 +1936,8 @@ def _UpgradeBeforeConfigurationChange(versionstring):
ToStdout("Backing up configuration as %s" % backuptar)
if not _RunCommandAndReport(["mkdir", "-p", pathutils.BACKUP_DIR]):
return (False, rollback)
if not _RunCommandAndReport(["tar", "cf", backuptar,
if not _RunCommandAndReport(["tar", "-cf", backuptar,
return (False, rollback)
......@@ -1216,7 +1216,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
(GANETI_RAPI_VERSION, instance)), query, None)
def ReplaceInstanceDisks(self, instance, disks=None, mode=REPLACE_DISK_AUTO,
remote_node=None, iallocator=None, reason=None):
remote_node=None, iallocator=None, reason=None,
"""Replaces disks on an instance.
@type instance: str
......@@ -1233,6 +1234,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
replace_auto mode)
@type reason: string
@param reason: the reason for executing this operation
@type early_release: bool
@param early_release: whether to release locks as soon as possible
@rtype: string
@return: job id
......@@ -1251,6 +1254,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
_AppendIf(query, remote_node is not None, ("remote_node", remote_node))
_AppendIf(query, iallocator is not None, ("iallocator", iallocator))
_AppendReason(query, reason)
_AppendIf(query, early_release is not None,
("early_release", early_release))
return self._SendRequest(HTTP_POST,
("/%s/instances/%s/replace-disks" %
......@@ -24,7 +24,12 @@ set -o pipefail
export PYTHON=${PYTHON:=python}
# Expand relative PYTHONPATH passed as passed by the test environment.
if [ "x$PYTHONPATH" = "x.:./test/py" ]
then export PYTHONPATH=$PWD:$PWD/test/py
err() {
echo "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment