Commit Graph

1333 Commits

Author SHA1 Message Date
Cole Robinson eb5cd8b2c9 host: Drop vestiges of old VM restore support
This hasn't been in the UI for a long time
2018-03-15 21:24:48 -04:00
Cole Robinson 56cf42e6ea engine: Only init systray if launching new app
We were doing it too early, and the systray could pop up for a moment
when connecting to a remote app
2018-03-15 21:24:48 -04:00
Cole Robinson cfe633f964 systray: Drop appindicator support
Does anyone care about this anymore? Unity is gone, if the libs are
present on a gnome install it's always been funky (currently doesn't
display an icon on f27), libappindator seems largely dead upstream,
and traditional systray icons give very similar behavior.

Kill it and see if anyone complains
2018-03-15 21:24:48 -04:00
Radostin Stoyanov b8b997fc3a pylint: Resolve consider-using-enumerate
Use enumerate instead of iterating with range and len.
This pylint message is emitted when code that iterates with range and
len is encountered. Such code can be simplified by using the enumerate
built-in. [1]

In addition, remove some unused variables to avoid warnings
`unused-argument` and `redefined-variable-type`.

[1] https://pylint.readthedocs.io/en/latest/technical_reference/features.html#id23

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:14 -05:00
Radostin Stoyanov 1ae5c4ff75 pylint: Resolve logging-not-lazy
A new Python checker was added to warn about using a + operator inside
call of logging methods when one of the operands is a literal string.

https://pylint.readthedocs.io/en/latest/whatsnew/1.8.html

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2018-03-03 16:04:12 -05:00
Cole Robinson 5ac2fe7fe4 libvirtenummap: Absorb similar functionality from domain.py
For mapping state enums to string names and other similar bits
2018-02-27 12:31:56 -05:00
Cole Robinson 1d8cd69f82 connection: Map event vals to libvirt enum names in debug output
Shove this logic into its own class LibvirtEnumMap in its own file,
since this may grow over time.
2018-02-27 12:31:56 -05:00
Cole Robinson da0d0600da connection: Show event name in debug output for xml misc events 2018-02-27 11:59:15 -05:00
Cole Robinson f04b284f21 xmlbuilder: Abstract libxml2 API and cleanup
Moves the libxml2 bits to a separate xmlapi file and class, a bunch
of cleanups to xmlbuilder internals dealing with XML stuff.

The main point is to experiment with different XML library impls,
since libxml2 is unfun to deal with and we are having python3
issues like

https://bugzilla.gnome.org/show_bug.cgi?id=776815
2018-02-20 11:23:37 -05:00
Cole Robinson 4c7c45908f manager: Fix mem, disk, net stats graphs (bz 1543896)
python2/3 division compat messed this up

https://bugzilla.redhat.com/show_bug.cgi?id=1543896
2018-02-09 14:02:04 -05:00
Cole Robinson dae8642bb1 xmlbuilder: centralize adding child new child prop instances
Currently the domain CPU class has a child property like:

  siblings = XMLChildProperty(_CPUCellSibling)

If a user wants to add a new sibling, we add a convenience function:

    def add_sibling(self):
        obj = _CPUCellSibling(self.conn)
        self.add_child(obj)
        return obj

Rather than require every child property to define a similar matching
helper function, this adds infrastructure in xmlbuilder to do this
generically for every child property. Now callers can do

    obj = guest.cpu.siblings.add_new()
2018-02-08 14:03:47 -05:00
Cole Robinson b42e37be1f Fix last bits of python3 pylint 2018-02-06 19:02:53 -05:00
Cole Robinson b8e2952a9c connect: Fix urllib usage on py3 2018-02-06 18:56:15 -05:00
Cole Robinson 3086c7fda9 Drop python3 compat imports
We are going completely python3
2018-02-06 18:56:15 -05:00
Radostin Stoyanov 4d9c6141dd Convert the output of range() to list
In Python 2 the range() function returns a list [1].
In Python 3 the range function returns a range type [2] which
represents an immutable sequence of numbers [3].

[1] https://docs.python.org/2.7/library/functions.html#range
[2] https://docs.python.org/3/library/functions.html#func-range
[3] https://docs.python.org/3/library/stdtypes.html#typesseq-range
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 5854b7bb17 Replace "Queue" with "queue"
The Queue module has been renamed to queue in Python 3. [1]

[1] https://docs.python.org/2/library/queue.html
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 95c695d774 Convert long to int
- Python 2 only
k = 9223372036854775808L

- Python 2 and 3:
k = 9223372036854775808

See http://python-future.org/compatible_idioms.html#long-integers
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 5553cbeb38 Replace ipaddr module with ipaddress
The `ipaddress` is available in Python 3.3+ [1] and backport for
Python 2 is available on PyPI [2].

The main differences between ipaddr and ipaddress are:

- ipaddress *Network classes are equivalent to the ipaddr *Network
  class counterparts with the strict flag set to True.
- ipaddress *Interface classes are equivalent to the ipaddr *Network
  class counterparts with the strict flag set to False.
- The factory functions in ipaddress were renamed to disambiguate them
  from classes.
- A few attributes were renamed to disambiguate their purpose as well.
  (eg. network -> network_address, numhosts -> num_addresses)
- A number of methods and functions which returned containers in ipaddr
  now return iterators. This includes subnets, address_exclude,
  summarize_address_range and collapse_address_list.

Another major difference is that in Python 2 the `ipaddress` module
must use unicode. [3]

[1] https://www.python.org/dev/peps/pep-3144/
[2] https://pypi.python.org/pypi/ipaddress
[3] https://github.com/phihag/ipaddress
2018-02-06 18:49:17 -05:00
Radostin Stoyanov 978fb25ac7 Wrap keys(), values() in a list
In Python 3 dict.values() [1] , dict.keys() [2] and dict.items() [3]
return a view [4] of the dictionary’s values, keys and items.

In Python 2 these functions return a list. [5] [6] [7]

To resolve this we can convert the result of these function to a list.

[1] https://docs.python.org/3/library/stdtypes.html#dict.values
[2] https://docs.python.org/3/library/stdtypes.html#dict.keys
[3] https://docs.python.org/3/library/stdtypes.html#dict.items
[4] https://docs.python.org/3/library/stdtypes.html#dict-views
[5] https://docs.python.org/2/library/stdtypes.html#dict.items
[6] https://docs.python.org/2/library/stdtypes.html#dict.keys
[7] https://docs.python.org/2/library/stdtypes.html#dict.values
2018-02-06 18:49:17 -05:00
Cole Robinson 2fc2eed938 Drop more cmp() usage for python3 2018-01-27 16:27:41 -05:00
Cole Robinson ec8ee78d18 addhardware: Only add virtio-scsi if no other scsi controllers present 2018-01-27 16:07:26 -05:00
Radostin Stoyanov 6712261510 Python 2/3 division compatability
In Python 2 the classic devision of integers returns an integer
but in Python 3 it might return float.

Example:
- Python 2:          - Python 3:
    >>> 9 / 4            >>> 9 / 4
    2                    2.25
    >>> 9 // 4           >>> 9 // 4
    2                    2
    >>> 9 / 4.0          >>> 9 / 4.0
    2.25                 2.25
    >>> 9 // 4.0         >>> 9 // 4.0
    2.0                  2.0

For more info see: https://www.python.org/dev/peps/pep-0238/
2018-01-27 15:30:17 -05:00
Cole Robinson a10fda6b5c uitests: console: Add live lxc serial test 2018-01-21 14:42:44 -05:00
Cole Robinson d774d01e1c uitests: Add live console tests
Using transient VMs connecting to real qemu:///system. uitests are
already system invasive so I think this is okay
2018-01-21 14:42:44 -05:00
Cole Robinson 94e4e8bf5a details: Tweak sound hwlist entry to be consistent with others
Dropping the colon
2018-01-21 14:42:44 -05:00
Cole Robinson 3ccb947ce3 uitests: Add choosecd dialog tests 2018-01-21 10:02:08 -05:00
Cole Robinson e4c6c64653 addhardware: Don't allow adding floppy controller
It's either built in, or not available
2018-01-21 10:02:08 -05:00
Cole Robinson dc3c0b29f7 uitests: addhardware storage/disk testing 2018-01-21 10:02:08 -05:00
Cole Robinson c620e7405c uitests: addhardware: add network tests 2018-01-21 10:02:08 -05:00
Cole Robinson 2f12823cb5 snapshots: Maintain selection after refresh 2018-01-18 16:55:57 -05:00
Pavel Hrdina 0e812e3c42 vnc: don't skip authentication for listen type none with fixed QEMU
This was fixed by commit <fa03cb7fd21> in QEMU.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2018-01-16 09:42:11 +01:00
Cole Robinson d8d71bddfb ui: Add createnet/pool/vol/interface tests 2018-01-11 21:02:34 -05:00
Cole Robinson 8716fd92af ui: connect: Add 'Custom URI' option
Proper UI option to just enter your own URI
2018-01-09 17:58:55 -05:00
Cole Robinson 08049bfb0b manager: Add accessible names to conn context menu
Needed to differentiate identical menu items in the ui test suite
2018-01-09 17:58:55 -05:00
Cole Robinson dc344fc8ee error: Add accessible strings for error dialogs
Makes UI testing easier
2018-01-09 17:58:55 -05:00
Cole Robinson 950e8803bc config: Explain and simplify our gsettings wrapper a bit 2018-01-09 17:41:20 -05:00
Cole Robinson 61158d3bce config: Use memory backend with --test-first-run
Meaning we start with a blank slate of gsettings data, and never
save anything to disk.
2018-01-09 17:41:20 -05:00
Cole Robinson b4a2c46f6a virt-manager: If --connect passed, wait for it to init
...before showing the UI. This helps the UI test suite be less
racy at least.
2018-01-09 13:51:53 -05:00
Cole Robinson ab1b4f8628 virt-manager: Gracefully exit app on ctrl-c, not sys.exit
Will be needed for uitests coverage support
2018-01-09 09:57:20 -05:00
Cédric Bosdonnat 50fd011153 oscontainer: ask root password in the wizard
When creating a new root file system out of an downloaded image,
the root password is likely to be changed. Add a field for this
in the new guest wizard.
2018-01-06 17:21:35 -05:00
Lin Ma c4c78d2894 details: Show attached disk information in scsi controller page
It helps users to recognize controllers <-> disks mapping relationship.

Signed-off-by: Lin Ma <lma@suse.com>
2018-01-06 16:40:30 -05:00
Lin Ma 12c5945be0 details: Disallow removing the scsi controller if disks attached to it
Through virt-manager, After we removed a virtio-scsi controller which
virtual disks still attach to it, Libvirt will add a LSI scsi controller
for this guest automatically and trigger a lifecycle event, virt-manager
updates and shows this new scsi controller in details panel once it got
the lifecycle event.

It may confuse user that a LSI scsi controller occurs while one removes
the virtio-scsi controller.

This patch prevents removing a scsi controller if any disks attaching to
it.

Signed-off-by: Lin Ma <lma@suse.com>
2018-01-06 16:40:30 -05:00
Lin Ma 066b91b2a0 ui: details: Add ui for showing attached controller devices in the future
Signed-off-by: Lin Ma <lma@suse.com>
2018-01-06 16:40:30 -05:00
Lin Ma 2c06086495 details: Rename the variable 'dev' to 'controller' in refresh_controller_page
Use the more appropriate name for more correctly identifies controllers.

Signed-off-by: Lin Ma <lma@suse.com>
2018-01-06 16:01:54 -05:00
Chen Hanxiao 3e3ffe1e2d pylint: remove a unnecessary pass
pylint complains:
  Unnecessary pass statement (unnecessary-pass)

Reviewed-by: Pavel Hrdina <phrdina.redhat.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-12-22 21:48:35 +08:00
Cédric Bosdonnat 0c6bcb0917 python3: fix bytes/string mess in serial console
Add a few encode() and decode() to convert between libvirt stream
functions expecting bytes arrays and Vte callbacks providing strings.
2017-12-20 16:09:35 -05:00
Cole Robinson b5b2433ad5 baseclass: Fix UI file loading on py3
We were passing in a unicode string object, but add_from_string
depends on knowing binary length. This caused signals to not
be registered which broke reopening the details window

Just switch to add_from_file to sidestep the issue
2017-12-20 16:04:36 -05:00
Cole Robinson c174b5509f connection: Another py3 exception variable fix 2017-12-20 14:16:13 -05:00
Cédric Bosdonnat 60968fa259 py3: store exception variables for use outside except
In python3 exceptions aren't defined outside the except block. Leading
to 'UnboundLocalError: local variable 'e' referenced before assignment'
errors.

To work around this, store the local variable into one that will have a
longer life.
2017-12-20 14:13:27 -05:00
Lin Ma 08b2b808bd addhardware: Remove IDE from list while adding controllers
Libvirt only supports built-in IDE controller so far, There is no
any case that needs us manually add an IDE controller, So remove
it from the controller list.

Signed-off-by: Lin Ma <lma@suse.com>
2017-12-20 13:15:46 -05:00