Commit Graph

80 Commits

Author SHA1 Message Date
Cole Robinson 382391eadb Clean up gtk STOCK and various image usage
- Remove most use of deprecated stock icons. Without it the UI will
  be a lot more ugly in Fedora 36
- Remove deprecated ImageMenuItem usage, convert to regular MenuItem
- Remove most embedded button images

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-02-19 15:33:42 -05:00
Cole Robinson 3d07b28a36 device: disk: Rename path property to get/set_source_path
This makes it more clear that 'path' is really a special designation
with a bunch of complicated logic behind it. It's also easier to
grep for

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-11-11 19:06:32 -05:00
Cole Robinson 16ebab2230 clone: Rework the UI
* Drop the network editing, users can use the details window
* Drop the combo box approach in favor of a regular treeview
* Drop a lot validation checks which are redundant with modern
  virtinst. We probably lose some checks but I don't think it's
  too important
* Use the cloner API
* Add uitest coverage

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-05 15:49:55 -04:00
Cole Robinson e45a2228dc objects: Erase the notion of connkey
Make it explicit that all uses of this is actually the object
name. We already leaked this abstraction in several places so better
to make it explicit. This also communicates to users that this is a
field that is not immutable so it shouldn't be used as a unique key

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson 8ff0da7664 connection: Pass object in -added/-removed signals
And not connkey. connkey == name, and name can change with object
rename, so it's a bad pattern to propagate that connkey can be used
as a static lookup key for objects. This begins unwinding it

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-09-01 14:27:11 -04:00
Cole Robinson 1684049fa3 virtManager: Misc coverage annotations
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-08-26 15:20:06 -04:00
Pino Toscano 6a39f2bb8b i18n: use single strings for network list in clone dialog
Create single strings for the networks in the clone dialog, including
all the available information at once instead of join pieces together.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano 71f034d6b6 i18n: fix string puzzles in error messages
Do not split the error messages and the error details, but rather use a
single string with proper placeholders. This avoids string puzzles.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Pino Toscano ed836c7138 i18n: avoid string puzzle
Create the complete sentence as single message, instead of joining an
existing message with few words more.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-14 11:23:57 -04:00
Cole Robinson fec9f0b136 po: Fix message format warnings printed from xgettext
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-11 19:18:38 -04:00
Cole Robinson a8d2438d5a devices: interface: Rename is_conflict_net -> check_mac_in_use
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-07-06 10:17:10 -04:00
Daniel Henrique Barboza 97eda595d3 virtManager/clone.py: codespell fix
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2020-07-04 17:56:57 -04:00
Cole Robinson 67ef81895e virtManager: Convert to CSS for most color usage
* Add CSS data in config.py and install it
* Strip out all hardcoded colors and use style class annotations
* Fix colors to be more theme appropriate to fix dark theme look

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2020-02-03 07:05:11 -05:00
Cole Robinson 657b2bcb26 storage: move supports_volume_creation to virtManager
It's the only user
2019-07-03 19:37:01 -04:00
Cole Robinson 3062b5ce08 virtManager: Move a lot of misc files to lib/ 2019-06-17 00:12:32 -04:00
Cole Robinson f107e39989 Switch to more traditional logging structure
Init a shared log instance in virtinst/logger.py, and use that
throughout the code base, so we aren't calling directly into
'logging'. This helps protect our logging output from being
cluttered with other library output, as happens with some
'requests' usage
2019-06-17 00:12:31 -04:00
Cole Robinson a2a09a49c7 clone: Fix syntax error 2019-06-16 19:23:27 -04:00
Cole Robinson b513388979 domain: Remove internal 'cloning' marker
qemu nowadays should reject the common cases here with its default
image locking. Our impl wasn't very good anyways so let's just leave
it up to the lower layers
2019-06-16 17:32:41 -04:00
Pavel Hrdina a02fc0d022 virtManager: clone: build default clone path if we know how
Function do_we_default returns only if we want to default to clone disk
even if we know how to create default clone path.  Only in case that the
storage pool is TYPE_DISK we don't know how to create default path and
we cannot default to clone that disk.  In all other cases as ReadOnly
disk or Shareable and so on we can prepare the default path for user if
they decide to clone it.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-06 17:19:00 +01:00
Pavel Hrdina 26a433fc42 virtManager: clone: check which storage pools supports volume cloning
When cloning a guest in virt-manager the GUI shows a list of disks and
select default cloning policy for every disk.  For storage pools where
we know that cloning is not possible we should not select that option
as default one.

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

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-03-04 13:23:45 +01:00
Cole Robinson 627bfabc32 pylint: Silence output on Fedora 29 2018-09-29 14:27:34 -04:00
Cole Robinson ebd6091cc8 devices: interface: Simplify is_conflict_net calls
We don't return a non-fatal error these days, so adjust all callers
to only handle failure
2018-09-04 14:55:04 -04:00
Cole Robinson fb1bb26373 support: Drop lots more checks
- Remove anything for less than qemu 0.12 or libvirt 0.10, basically
  rhel6 vintage stuff
- Open code some simple checks
- Remove some that are only used for unnecessary error reporting
2018-08-31 22:21:15 -04:00
Daniel P. Berrangé 48e32b429d Fix copyright header to specify GPLv2 or later, not GPLv2 only.
The copyright headers in every file were chjanged in this previous commit

  commit b6dcee8eb7
  Author: Cole Robinson <crobinso@redhat.com>
  Date:   Tue Mar 20 15:00:02 2018 -0400

    Use consistent and minimal license header for every file

Where before this they said "

  "either version 2 of the License, or (at your option) any later version."

Now they just say

  "GNU GPLv2"

This fixes it to say "GNU GPLv2 or later" again.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2018-04-04 16:51:37 -04:00
Cole Robinson eee1caa946 domain: Drop most device list wrappers
There's lots of hacks stuffed into the domain device lists. Formalize
some of it, move some of the specific stuff to details.py, and drop
a lot of the needless API wrappers
2018-03-21 16:10:45 -04:00
Cole Robinson b6dcee8eb7 Use consistent and minimal license header for every file 2018-03-21 07:29:40 -04:00
Cole Robinson 1c911ce567 virtinst: Give device classes consistent DeviceX naming
Previous state was inconsistenty and needlessly wordy. Fix up
a few other class namings that have redundant Virtual in the name
2018-03-21 07:29:40 -04:00
Cole Robinson 4d4a07c65b tests: uitests: Add window cleanup tests
And fix some bugs I found as a result
2018-03-17 19:42:19 -04:00
Cole Robinson 3c1e0a8a12 virtManager/*: Give pylint hints about singleton classes
It can't seem to figure out that what 'cls' is in this context,
so make it explicit.
2018-03-17 18:46:39 -04:00
Cole Robinson cad809fe80 Make all dialogs clean up when vm/conn disappears
Moves all the window cleanup handling to each class and audit for
all --test-leak-debug errors and fix
2018-03-15 21:24:48 -04:00
Cole Robinson 58f872a205 clone: Convert to per-connection singleton-ish pattern
And convert the dialog VM handling to match other dialogs
2018-03-15 21:24:48 -04:00
Cole Robinson b25c38816a pylint: Enable 'fixme' checking
Using these for long term TODO type items is not effective, however
it's nice to label things as FIXME during a coding session and have
pylint warn you about them before pushing.
2018-03-15 21:24:48 -04: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
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
Chen Hanxiao b44aa0e3bb pycodestyle: fix all E131 warnings
Fix all E131:
     Continuation line unaligned for hanging indent

   Also remove ignore options of E131

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-26 20:03:21 +08:00
Chen Hanxiao c92aade081 pycodestyle: fix all E203 warnings
Fix all E203 whitespace before ':'
   Also remove E203 ignore option of pycodestyle

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
2017-08-11 00:01:38 +08:00
Radostin Stoyanov b93cc3bbc9 pycodestyle: Do not use bare 'except:'
A bare 'except:' catches all exceptions [1], including SystemExit,
KeyboardInterrupt, and GeneratorExit (which is not an error and should
not normally be caught by user code). In situations where you need to
catch all “normal” errors, you can catch the base class for all normal
exceptions, Exception [2].

[1] https://docs.python.org/2/howto/doanddont.html#except
[2] https://docs.python.org/2/library/exceptions.html#Exception
2017-08-02 13:57:43 -04:00
Cole Robinson 9863a963fe virtManager: clone: drop redundant clone setup
We already handle all these steps in the validation() step, which
happens directly before this code.
2017-07-20 17:27:22 -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 c0a3234633 baseclass: share wizard cursor setting code 2017-04-27 15:00:17 -04:00
Cole Robinson 1ac02d2ade ui: clone: Delay error if default storage doesn't have enough space
Just ignore the error populating the initial paths, otherwise we can't
even open the dialog
2017-03-06 22:05:34 -05:00
Cole Robinson b6630c2a63 clone: Don't error if disk doesn't have a backing volume 2017-03-06 22:05:34 -05:00
Pavel Hrdina 31e923dbdf virtManager.clone: don't generate default clone_path for some storage pools
Libvirt doesn't support creating volumes for some storage pools,
don't generate default clone_path for these storage pools.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina 79baf8e30c virtManager.clone: don't generate clone path if we don't default to clone
If we don't default to clone the disk in question don't try to generate
and assign default clone_path, this will force user to select the path
explicitly and avoid some unnecessary errors in debug log.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Pavel Hrdina d93203022a virtManager.clone: set new manual path before we populate storage list
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2017-03-06 14:31:42 -05:00
Cole Robinson 435de2d40c pylint: Fix some issues with F25 version 2016-12-13 12:36:49 -05:00
Pavel Hrdina c7049eb120 pep8 W503: line break before binary operator
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-07-14 13:01:20 -04:00
Cole Robinson 996c8b76b8 clone: Use conn desc if showing destination conn 2015-04-21 16:33:41 -04:00
Cole Robinson 7b1a4634a8 clone: Refresh cached pools after storage creation 2015-04-14 18:42:56 -04:00
Cole Robinson 058c06972e Break out shared storage UI to storagelist.py (bz 1060433)
We were already sharing a chunk of this in a haphazard way. Now officially
break it all out, similar to netlist.py. This mostly unifies the views
of host->storage and storagebrowser.py
2015-04-09 12:31:24 -04:00