Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I2de669d8e89b8daeb7ee5405ffab35af6307c40b
We don't support Python 2 anymore so we don't need this
compatibility library.
six.reraise usages are left as is until it'll be moved to some
base lib like oslo.utils to not re-implenent this method in
Horizon.
This patch also removes Python2-specific base test case methods
assertItemsEqual and assertNotRegexpMatches in flavor of new
Python 3 analogues.
Change-Id: I0b567382edf4d68674a7b8d0b02333fb57293958
As seen here [1]. With this change, all test are passing with Django
2.2.
[1] https://github.com/django/django/commit/6fe9c45b725
Change-Id: Idef0bd9dff4b27d22cfb756fc248c5c6bd24e097
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit mainly covers settings
in openstack_dashboard/dashboards/admin/.
Part of blueprint ini-based-configuration
Change-Id: Ifb3e9401a926ba9e035e1b498a4a4493c1b594f5
After dropping the flavor edit feature was dropped in Rocky-1,
we still allow to edit flavor in the "Modify Access" form.
This commit drops the remaining flavor edit forms.
Duplicated API calls (flavor_get and flavor_access_list)
in the UpdateFlavorAccess form are refactored into one API
call per request.
Change-Id: I009fe285d2263fd9b9f07ed1c3f4c96df261b535
Closes-Bug: #1766053
- Add use_mox = True to tests which still depend on mox
- Remove use_mox = False from all tests converted into mock
- Update the warning messages
- Replace 'S'-release with 'Stein'
Part of blueprint mock-framework-in-unit-tests
Change-Id: I208185e97b2de346304a09643a9cb3f1425a7683
Signed-off-by: Akihiro Motoki <amotoki@gmail.com>
(In Django 2.0) The django.core.urlresolvers module is removed
in favor of its new location, django.urls.
It was depreacted in Django 1.10:
https://docs.djangoproject.com/en/2.0/releases/1.10/#id3
blueprint django2-support
Change-Id: I46ab5c325491274b8eaffbf848e5d80f83c2fd26
This patch drop name validation in horizon and
let nova check if the is name is valid or not.
Instead of using pattern in the flavors form,
pattern will be checked in the nova. Also I
added limation for the name size with tests to
check the max size since the min size has it's unit
test.
Closes-Bug: 1738328
Change-Id: Ib4f6f9b87560df43819d992254603e55ea8ff6a3
To ensure project imports are placed after third party import,
we need to specify application-import-names.
Previously flake8-import-check checks only standard imports or not.
Change-Id: I9beb2105f686dc7d9aebfce8e21c5e182698e2fe
attribute-level imports are not checked by hacking module now.
most noqa is used to disable warnings on attribute-level imports.
This commit drops noqa for this purpose.
After this, there are only 3 noqa under openstack_dashboard/ :)
Change-Id: I4a449802f5dbd6e44e4b8b5c378a555d47d9a99f
More link for flavors table is already supported, this patch adds
support to prev link for flavors table.
Implement blueprint: pagination-for-flavor
Change-Id: I3111e929c59077a0e52bf8f84a512ee18eee5f12
Nova and novaclient already support pagination for flavor, it would be
nice to have this in horizon. Adding pagination for flavors table.
Implement blueprint: pagination-for-flavor
Change-Id: Icff51302158263f2101a78519f509415514cd880
Such as in Nova CLI, during flavor create/update the
swap and ephemeral fields should be optional.
If Nova receive an empty value in swap or ephemeral
field sets it to "0"
Change-Id: I896e4fa842a1cf6213f564d8890931a0818b657a
Closes-Bug: #1480343
mox doesn't work on Python 3, whereas mox3 works on Python 2 and Python
3. Cinder, Nova and many other projects already replaced mox with mox3.
mox3 is now maintained by OpenStack.
Partial-Implements: blueprint porting-python3
Change-Id: I10e6a9754ebd58a2640d73ec8966527c3aa1fe9a
Fix review comments on https://review.openstack.org/#/c/112874/
in admin/flavors/views.py regarding exception handling. Also
adding unit test to test negative scenario after changes.
Closes-Bug: 1369678
Co-Authored-By: Bartosz Fic <bartosz.fic@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
Change-Id: I5ea1216a22560cc0e8a5ba57be548b54674db689
Nova currently expose an api to let the users update
the flavors metadata so horizon should expose
this functionality. At the same time Glance is exposing
a metadata dictionary in Juno, where users can register
the key/value pairs that describe their cloud deployment.
This patch uses the glance metadata api to expose the available
metadata and the nova api to update the aggregates metadata.
Implements: blueprint glaance-metadata-flavors
Co-Authored-By: Santiago Baldassin <santiago.b.baldassin@intel.com>
Co-Authored-By: Pawel Skowron <pawel.skowron@intel.com>
Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
Co-Authored-By: Michal Dulko <michal.dulko@intel.com>
DocImpact:
New UI. FLAVOR_EXTRA_KEYS setting deprecated.
Change-Id: Ica9d3d06314a4d5afa77f644bd1f8900a1c328f7
Warnings H904, H307 and H405 are new or considerably changed, and will
be fixed in a separate patch.
Closes-bug: #1349820
Partial-bug: #1347472
Change-Id: I4fd28990dacf16f03a4eaa6074ef59c37f1a2c14
UX improvement: Adds a column to the Flavors DataTable to show if
any Extra Specs have been defined for the flavor. Also contains a
LinkAction to open the Extra Specs view for the flavor
BP: extra-specs-as-column
Change-Id: I044b86c366c6687f4b0e9870371ef63a2066083d
The Nova API makes the implicit assumption that flavorids are unique,
so if one creates two flavors with the same flavorid, subsequent
requests for flavor information can vary between "inaccurate" and
"wildly f*cking inaccurate"
From an end-user perspective, it makes it look like data such as
flavor access settings get lost between edits (because the API pulls
the access list from the wrong flavor)
Let the API assign a new flavorid on changes. The comments around
the handler code imply that is the desired behaviour, anyhow.
Change-Id: I5403202396a7b136b0ae8637d6aae1cf32550747
Closes-Bug: 1276371
If flavor properties are invalid, an update message error
is shown, but the flavor get deleted.
The reason is that update flavor is not yet supported so horizon
will delete the flavor and create a new one, failing in the last case.
Fields ram and vcpus need to be >= 1 and eph_gb, swap_mb and disk_gb
>= 0 to create a flavor.
Change-Id: I20d178bad6e4e50c0963acdec72ebedb9bbaba17
Closes-Bug: #1269638
We have a lot of import with #noqa that is there to ignore h302,
because it's traditional to import and use a name directly, instead
of a whole module. This hides other errors and gives people the
impression that it's actually fine to import non-modules, you just
have to slap #noqa on those lines.
I went through the code and identified about a dozen names that are
most commonly imported this way. I remove the #noqa tag from them,
and added them to the list in import_exceptions.
I also removed a few unused imports that were revealed in the process.
Change-Id: I27afb8e2b1d4759ec974ded9464d8f010312ee78
Now all files are properly licensed per OpenStack Hacking.
Change-Id: I223d983018568357197b0d9cf5dde12c135c53c9
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
Change CreateFlavor/EditFlavor forms to CreateFlavor/UpdateFlavor
workflows. Provide access flavor management in each project. Add
the filtering function in Flavors page.
Implements blueprint define-flavor-for-project
Change-Id: I723bbf250a46af8de58de06a907f6efc737778db
This patch replaces some method imports with module imports and
makes H302 test enabled.
Fixes bug 1188531
Change-Id: Ibfbddeaa19cbbb244da58ffd5c918c41f03a0c65
Flavor ID supported values are:
* integer
* uuid4
* auto
Using 'auto' generates a random uuid4.
Clean method from Edit Form removed as unnecessary.
Flavor tests updated.
Fixes: bug #1189877
Change-Id: I222836d7a84b66891d5380f323bf123122044d30
This check looks to see whether a local variable
is unused. Also fixed all violators of said check.
Change-Id: I7c186df41b5601078ffc54588aace8136c6576bd
This patch also re-organizes imports to import one per line.
Change-Id: Ia958e3a30a48d4308d08d51df243c1272425c316
Fixes: bug 1188529
Fixes: bug 1188537
Adds an extra check to the EditFlavor form
in order to avoid losing the flavor if an
existing name is setted as the new name.
This control is needed because the current
edit implementation is based in a
delete-create action.
Change-Id: I4251c64fa4719831a1ed949bf95349a350dd303d
Fixes: bug #1133254
https://bugs.launchpad.net/horizon/+bug/1086290,
edit-flavor broken when flavor has extra specs.
Includes unittest for the same, and modified mock data to
to include extra-specs
Change-Id: I286d97568daff26bbd03418b2ea0b808caceadba
At the moment the swap disk entry of flavors is not listed in
the syspanel listing of flavors and it's not possible to create
a new flavor or edit an existing flavor with the swap size
Change-Id: I92195671024bb361fa5825cbdcea515850ddee31
Change the type of flavor_id hidden field in EditFlavor form
from IntegerField to CharField since flavor id is a string
representation of UUID now. Additionally change the type of
similar hidden fields in CreateExtraSpec and EditExtraSpec forms.
Remove flavor id generation from form handling code. Id generation
should be done only in corresponding OpenStack components (nova, etc.).
Since nova supports flavor id autogeneration and 'flavorid' parameter
of FlavorManager.create() in novaclient is optional, remove 'flavorid'
parameter from api.nova.flavor_create().
Change flavor ids in test data from strings containing integers
to UUID-like strings to make them correspond to real data.
Update flavor tests to make them compatible with new
api.nova.flavor_create() signature.
Remove conversions of flavor id to int from all tests. In particular,
update test_index_flavor_get_exception() to make it generate unique
UUID flavor ids instead of integers.
Fixes bug #1076761
Change-Id: Iaa308578981f0379ff61a9dd42620eaf0ab1d605
When trying to create a flavor with an Id/Name that is already in use, the
operation fails and no error message is being displayed
Change-Id: I92db8b52bc4e63e5e5ce4d90169944e484baeddd
Fixes: bug #1079155
Special thanks:
* Preserves extra specs on flavor edit (Tihomir Trifonov)
* Displays flavor name on extra specs pages (Vinay Bannai)
* Extras specs table close (Don Dugger & Gabriel).
* Final cleanup (Gabriel Hurley)
Change-Id: I6acb1176e5c0ca6987abc758fc45335870c55d57
Now that Nova accepts strings as flavor IDs we can just use UUIDs
on our end and get rid of the horrors of trying to guess the next
integer ID. This fixes all the instability in flavor editing.
Fixes bug 1057799.
Change-Id: I55eb1d7408655fd27e81cc1196f15ceb3659a7b4
Moves everything OpenStack-specific (dashboards, apis, etc.)
into the openstack_dashboard project, achieving a much
cleaner separation between the project-specific code and
the generic Horizon framework code.
Change-Id: I7235b41d449b26c980668fc3eb4360b24508717b