Commit Graph

37 Commits

Author SHA1 Message Date
Cole Robinson ddba9c1702 Switch to python3 in script shebang
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2018-02-06 18:56:15 -05:00
Cole Robinson 8b4befae60 virtinst: Drop UUID validation
It's redundant as libvirt will give us these checks already, and we
aren't even testing it
2017-12-14 12:45:01 -05:00
Chen Hanxiao 7f1b4cee82 pycodestyle: fix all E125 warnings
Fix all E125:
     Continuation line with same indent as next logical line

   Also remove ignore options of E125

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-10-21 23:26:16 +08:00
Cole Robinson 4e7a6ad728 tests: pylint: Silence/fix a bunch of new warnings 2017-06-16 12:54:56 -04:00
Cole Robinson 62feeb02a8 Switch to python3 style 'except X as Y' notation
Which also works with python2.7
2017-05-05 14:52:11 -04:00
Cole Robinson 38c10f70f8 virt-xml: Only print message if changes are applied 2017-03-06 22:15:46 -05:00
David H. Gutteridge 9a451e6faa Remove minor redundancy in action_remove_device()
There's no need to call util.listify() twice.
2017-02-16 13:31:32 -05:00
Cole Robinson 118bf85cba Apparently -tt doesn't work with #!/usr/bin/env ... 2016-06-17 16:38:57 -04:00
Cole Robinson 47dd38eb3e Use #!/usr/bin/env for python scripts
This is recommended for upstream, but not for downstream, like Fedora.
So change /usr/bin/env to /usr/bin/python2 at RPM install time to
match the ideal Fedora config.

https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
https://bugzilla.redhat.com/show_bug.cgi?id=1303282
2016-06-17 12:56:14 -04:00
Cole Robinson 984b368725 cli: Rework VirtCLIParser instantiation
Only initialize VirtCLIParser at actual parse time. The data that's
passed to __init__ is the particular data for that parse task, like
the option string, and the Guest object we are editing.

As a result we can drop the whole parsermap handling, since the
parserlist is immutable.

There's a bunch of other reworks mixed in like dropping the
VirtOptionString abstraction...
2016-06-14 10:51:50 -04:00
Cole Robinson 3ce5af712b cli: Drop unused VirtCLIParser.option_variable_name 2016-06-13 19:15:35 -04:00
Cole Robinson 68962f48f7 virtinst: Support multiple seclabels
libvirt has supported this for a while. Wire it all up through the
cli, and fix some bad assumptions along the way.
2015-09-05 13:49:36 -04:00
Cole Robinson 4d87d2f27b cli: Make child lookup not specific to guest devices
<seclabel> is not singleton nowadays, so we need to extend our
infrastructure to handle non-device child properties. This is part of
that
2015-09-04 16:16:25 -04:00
Pavel Hrdina 76bad650de virt-xml: refactor the handling of --define and --update options
The code was wrong in many ways.  The main issue was, that for live
updates we were using config XML instead of live XML.

This patch fixes the --update and --define options to work properly as
described in man page.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1192875

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-07 10:42:32 -04:00
Pavel Hrdina 0fbe8e7a1f translation: fix wrong usage of _() function
All the strings have to be at first translated and then we can fill the
formated and translated string.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-06-05 16:33:51 -04:00
Cole Robinson d4bf3b58a0 clitest: Drop prompttest infrastructure
Just fake it for the one remaining test
2015-04-22 18:00:00 -04:00
Cole Robinson 93f826a8b2 cli: Replace add --check option (bz 1063471)
For fine grained enabling/disabling validation checks. Use this to
replace the heavy handed --force option.
2015-04-11 19:48:35 -04:00
Cole Robinson 99700821c6 virt-install: Reorder --help output a bit 2014-09-20 19:30:16 -04:00
Cole Robinson 0ad7611b59 virt-xml: Tweak update prompting messages 2014-09-17 12:21:49 -04:00
Martin Kletzander 4196f4287b Use proper python version
since we work with python2 only, mentioning it in all shebangs make
the commands from git work even when python3 is set as default.

This also fixes one test where command being ran is 'virt-xml' through
subprocess.Popen().

While at that, add '-tt' where possible in order to make everyone use
same indentation characters.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2014-02-12 21:55:32 +01:00
Chen Hanxiao b53b3874a4 virt-xml: add "-c" as short option of "--connect"
Add "-c" as short option of "--connect" for virt-xml.

We could use either
virt-xml -c lxc:///
or
virt-xml --connect lxc:///

This will be more convenient if we operate
non-default hypervisor.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-12 22:57:40 +08:00
Cole Robinson ac6706208d cli: Shorten some long --help examples 2014-02-10 18:13:42 -05:00
Cole Robinson d76aab264e tests: Only use one env variable to notify we are running tests 2014-02-10 14:47:20 -05:00
Chen Hanxiao fcac052cdc virt-install: add support for user namespace
This patch will enable configuring idmap.
It could be used as enable user namespace
for LXC containers.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-09 13:16:34 -05:00
Chen Hanxiao dbfa8166b1 virt-xml: fix a terminal_width depends issue
One of virt-xml test case will output logs by
urlgrabber.process, which will get the real width of
terminals.
If we resize terminal, of who is running test, from
80 to other size, test case will fail.
This patch will screen it when running test case.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-02-07 23:05:41 +08:00
Cole Robinson 2688ca64bb virt-xml: Fill in man page 2014-01-26 13:09:26 -05:00
Cole Robinson 57e89cda8b virt-xml: Create storage if necessary 2014-01-26 13:09:26 -05:00
Cole Robinson 443ae1b303 virt-xml: Change clear format to clearxml=yes, add --help example 2014-01-25 20:30:08 -05:00
Cole Robinson 110d6aac83 virt-xml: Add --build-xml option for just outputing XML 2014-01-25 20:30:08 -05:00
Cole Robinson 48f69dd638 virt-xml: Add --update option for hotplug/hotunplug 2014-01-25 19:51:56 -05:00
Cole Robinson ecfc1a527d virt-xml: Make --domain positional, allow stdin XML 2014-01-25 18:16:16 -05:00
Cole Robinson 6fa2876486 virt-xml: Actually update the INACTIVE xml 2014-01-25 17:20:30 -05:00
Cole Robinson e49e61f71e virt-xml: Add --add-device and --remove-device options 2014-01-25 17:20:30 -05:00
Cole Robinson 927a7ef265 cli: Add --metadata option
Can take name, description, uuid, and title (new). This deprecates the
separate --description and --uuid element, but we won't require it for
specifying a name with virt-install/virt-image since that's quite
overkill. Allowing --name with this option is mostly for the benefit
of virt-xml.
2014-01-25 17:20:29 -05:00
Cole Robinson ec359fd5b2 cli: Add --disk readonly and shareable options
This deprecates the difficult perms= sub option
2014-01-25 17:20:29 -05:00
Cole Robinson 7ba76b5748 cli: Add --memory, deprecates -r/--ram
This is a compound option like we use elsewhere, with suboptions for
maxmemory and hugepages.
2014-01-25 17:20:29 -05:00
Cole Robinson 748ff1c4cc virt-xml: Initial commit, basic set of tests 2014-01-25 17:20:29 -05:00