On Wed, 2014-10-01 at 16:05 +0200, Martin Kolman wrote:
Add the missing support for the autostep [--autoscreenshot]
kickstart
command to Anaconda. If just autostep is specified, Anaconda will
iterate over all active spokes just before leaving a hub. If the
--autoscreenshot option specified, it will also take a screenshot of
all hubs and of each spoke.
Also turn the take-screenshot code into a proper function that can be
called when auto-screenshotting and remove the old copy-screenshot
post-script (the last batch of screenshots is taken after the
postscripts have run, so screenshot copying is now handled
elsewhere).
Resolves: rhbz#1059295
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
data/post-scripts/90-copy-screenshots.ks | 10 ---
pyanaconda/constants.py | 4 +
pyanaconda/iutil.py | 27 +++++++
pyanaconda/ui/gui/__init__.py | 134 ++++++++++++++++++++++++++-----
pyanaconda/ui/gui/hubs/__init__.py | 42 ++++++++++
pyanaconda/ui/gui/spokes/__init__.py | 9 +++
pyanaconda/ui/gui/spokes/welcome.py | 5 +-
7 files changed, 201 insertions(+), 30 deletions(-)
delete mode 100644 data/post-scripts/90-copy-screenshots.ks
diff --git a/data/post-scripts/90-copy-screenshots.ks
b/data/post-scripts/90-copy-screenshots.ks
deleted file mode 100644
index 471e2b1..0000000
--- a/data/post-scripts/90-copy-screenshots.ks
+++ /dev/null
@@ -1,10 +0,0 @@
-%post --nochroot
-
-if [ ! -d /tmp/anaconda-screenshots ]; then
- exit 0
-fi
-
-mkdir -m 0750 -p $ANA_INSTALL_PATH/root/anaconda-screenshots
-cp -a /tmp/anaconda-screenshots/*.png $ANA_INSTALL_PATH/root/anaconda-screenshots/
-
-%end
diff --git a/pyanaconda/constants.py b/pyanaconda/constants.py
index 2c8ca11..45b2ca8 100644
--- a/pyanaconda/constants.py
+++ b/pyanaconda/constants.py
@@ -150,3 +150,7 @@ IPMI_FAILED = 0xA
# Recognizing a tarfile
TAR_SUFFIX = (".tar", ".tbz", ".tgz", ".txz",
".tar.bz2", "tar.gz", "tar.xz")
+
+# screenshots
+SCREENSHOTS_DIRECTORY = "/tmp/anaconda-screenshots"
+SCREENSHOTS_TARGET_DIRECTORY = "/root/anaconda-screenshots"
diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py
index d30947a..30952c0 100644
--- a/pyanaconda/iutil.py
+++ b/pyanaconda/iutil.py
@@ -28,11 +28,13 @@ import errno
import subprocess
import tempfile
import unicodedata
+import shutil
from threading import Thread
from Queue import Queue, Empty
from pyanaconda.flags import flags
from pyanaconda.constants import DRACUT_SHUTDOWN_EJECT, ROOT_PATH,
TRANSLATIONS_UPDATE_DIR, UNSUPPORTED_HW
+from pyanaconda.constants import SCREENSHOTS_DIRECTORY, SCREENSHOTS_TARGET_DIRECTORY
from pyanaconda.regexes import PROXY_URL_PARSE
import logging
@@ -82,6 +84,14 @@ def setSysroot(path):
global _sysroot
_sysroot = path
+def sysroot_path(path):
+ """Make the given relative or absolute path "sysrooted"
+ :param str path: path to be sysrooted
+ :returns: sysrooted path
+ :rtype: str
+ """
+ return os.path.join(getSysroot(), path.lstrip(os.path.sep))
With this patch
pushed I think we should go through our code and use
this new function in many other places.
ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic