[virt-tools-list] [virt-bootstrap] [PATCH v3 01/24] sources: Set default format with a constant
Radostin Stoyanov
rstoyanov1 at gmail.com
Wed Aug 2 12:08:15 UTC 2017
---
src/virtBootstrap/utils.py | 2 ++
src/virtBootstrap/virt_bootstrap.py | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/virtBootstrap/utils.py b/src/virtBootstrap/utils.py
index 2c79d6b..dbe4677 100644
--- a/src/virtBootstrap/utils.py
+++ b/src/virtBootstrap/utils.py
@@ -38,6 +38,8 @@ import passlib.hosts
# pylint: disable=invalid-name
# Create logger
logger = logging.getLogger(__name__)
+
+DEFAULT_OUTPUT_FORMAT = 'dir'
# Default virtual size of qcow2 image
DEF_QCOW2_SIZE = '5G'
if os.geteuid() == 0:
diff --git a/src/virtBootstrap/virt_bootstrap.py b/src/virtBootstrap/virt_bootstrap.py
index c9bf1c8..ddc5456 100755
--- a/src/virtBootstrap/virt_bootstrap.py
+++ b/src/virtBootstrap/virt_bootstrap.py
@@ -165,7 +165,7 @@ def mapping_uid_gid(dest, uid_map, gid_map):
# pylint: disable=too-many-arguments
def bootstrap(uri, dest,
- fmt='dir',
+ fmt=utils.DEFAULT_OUTPUT_FORMAT,
username=None,
password=None,
root_password=None,
@@ -267,7 +267,7 @@ def main():
help=_("Map both UIDs/GIDs"))
parser.add_argument("--no-cache", action="store_true",
help=_("Do not store downloaded Docker images"))
- parser.add_argument("-f", "--format", default='dir',
+ parser.add_argument("-f", "--format", default=utils.DEFAULT_OUTPUT_FORMAT,
choices=['dir', 'qcow2'],
help=_("Format to be used for the root filesystem"))
parser.add_argument("-d", "--debug", action="store_const", dest="loglevel",
--
2.13.3
More information about the virt-tools-list
mailing list