Commit Graph

37 Commits

Author SHA1 Message Date
Kevin Masterson 104c474479 Now checks for code 202 when checking for success for other operations.
Task: 41574
Story: 2008505
Change-Id: I58ea7dc0aae66a38a00ed68e6c6b2cd9a4cbd32b
2021-02-15 12:45:37 -05:00
Kevin Masterson 208181a569 Now checks for code 202 when checking for success
Task: 41574
Story: 2008505
Change-Id: I99e88b5786940fdc73b9afa25fdd6638a811eb9a
2021-01-12 17:00:53 -05:00
Kevin Masterson 9c5660acbb Comparison exception causes quota output to fail
The key/value pairs being checked include the quota's id, and the value
is a UUID. Being that this is the only key where the value is not an
integer, this causes issues with Python 3's rules for comparisons
between different types. This manifests as a "Failed to list quota
sizes." error when viewing a region's quota information. This patch
will catch this exception and allow it to continue as before, without
modifying the value.

I opted for this method instead of just skipping 'id' at the start of
the loop since this is closer to the original behavior, and there is
already an explicit check for 'id' at the bottom before adding to the
output. This way, any future keys that also have non-int values will
be handled gracefully as well.

Change-Id: Ib0e53572bfc8600094a6f8483e26bf2d0023ce80
2021-01-12 08:08:13 -05:00
Sean McGinnis d528b3cee4
Use unittest.mock instead of third party mock
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: Icc42a058851448152ddc86fded6b8808e2e704a4
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-20 09:37:25 -05:00
Andreas Jaeger a9a49899c2 Fix some flake8 warnings
fix and enable:
- E121 continuation line under-indented for hanging indent
- E126 continuation line over-indented for hanging indent
- E226 missing whitespace around arithmetic operator
- H306  imports not in alphabetical order
- H401  docstring should not start with a space

Change-Id: I1dab6908652924931e750187380d153d64eba2b6
2020-02-21 09:12:15 +01:00
Adrian Turjak 5d34774f0a Change Adjutant UI to use the correct service type
Keep a fallback to the old one to ease migrations.

Change-Id: Ic7e1e554a3c4197a09fe52f01fadcc10ccb534cc
2020-02-19 15:27:10 +13:00
Zuul b014b2e49f Merge "Upgrade app for Django >= 2.0 compatability" 2020-02-19 01:03:59 +00:00
Simon Merrick 1569cc47f9 Upgrade app for Django >= 2.0 compatability
Change-Id: I9c2ecf330d08d47e44d41d7c2f9ba3a21d023f3b
2020-02-04 15:19:04 +13:00
Adrian Turjak 8d8c361b4a Update Adjutant-UI to handle 202 http codes
This matches the new changes to Adjutant as part of
the refactor to split API and Workflow layers.

202 will be the most common response code when dealing
with the creation of new tasks due to future async
task processing.

Change-Id: Ia09a070709b8a2973c9149df91c67af2b69199a0
2020-01-28 11:24:59 +13:00
Zuul 7e5b950098 Merge "Fix the misspelling of "available"" 2020-01-23 00:29:29 +00:00
Andreas Jaeger aa114828a0 Remove six usage
This repo does not support Python 2 anymore, so we don't need
six for compatibility between Python2 and 3, convert six usage to Python
3 code.

Needed-By: https://review.opendev.org/701743
Change-Id: Ia51c0af5df488069f3048f632f56774dcb4344ef
2020-01-11 15:48:35 +00:00
lijunjie fc3e47bf49 Fix the misspelling of "available"
Change-Id: Ic5c82580e1b968b2fab21a00f067cb15420b5dc4
2019-01-22 13:43:24 +08:00
Adrian Turjak 64b7a8c58f Get rid of iteritems in favor of items
Change-Id: I8cb19d301be92b7c6f4a26b4616547221f77caf0
2019-01-17 16:24:04 +13:00
Akihiro Motoki baeb8879a2 Drop nose dependencies
Horizon test setting no longer depends on nose and related stuffs.
This commit cleans up nose related dependencies.

Filenames of test modules need to start with test_*
so that Django test runner detects them.
There is no test defined but it would be nice to adjust the filename.

Also moves horizon dependencies to requirements.txt.

Change-Id: Ib2f246d76da8a1f5d26a9cf8e9ef27e5f4f62bee
2018-08-17 02:16:42 +09:00
Zuul 8f8022d3b8 Merge "Fixes to match Horizon Rocky" 2018-05-03 02:39:35 +00:00
Adrian Turjak bb878a3f33 Fixes to match Horizon Rocky
Horizon in Rocky 'fixed' recursive inheritance but this
in turn broke our use of overextends. As such we drop
overextends for Rocky onwards, but this means Adjutant-UI
from Rocky onwards only works with Horizon from Rocky onwards.

This also fixes issues with quota naming cleanup which was
changed in Horizon proper.

Change-Id: I60fa4e8e751bb62760830e37775c42b9900fb59c
2018-05-02 16:08:38 +12:00
Adrian Turjak 4396ad3c87 Fix key error with unknown service in size
When Adjutant has sizes defined for a service that
only exists in certain regions, this can cause errors.

If we come across a region without that service, skip
the service.

Change-Id: Icc6b8cc3aaed408c10dc4fb54c54fe2376cf2a88
2018-05-02 12:59:27 +12:00
Adrian Turjak 479618c775 rename project users internal column name
This column should have always been roles, this renames that
properly. No point having the data source be called roles
and the column be called role.

Change-Id: I6ce736bfa1449fccf8f9f96d504a236546d76e82
2018-03-27 16:41:43 +13:00
Adrian Turjak d93485a8a3 Use include_usage param in adjutant quota get view
Adjutant-ui was requesting data for all regions when
it didn't need usage for all regions. This gives us a
way to avoid that.

Change-Id: Iecb474b86c6cd1454f4eb61f7b1326bd65b1dcfa
2018-02-14 12:29:34 +13:00
Adrian Turjak 379709c979 Clean up service and role translations
* add documentation for settings
* clean up documentation
* split role help into own template
* remove old debug print statements

Change-Id: Id764dca96e37627974c77181e73634f461ab10b1
2018-02-13 18:03:20 +13:00
Adrian Turjak 0c836b1cac rename request date for notifications correctly
Change-Id: I24e61408711434044aa69eebeaa27dd323c1509d
2018-02-13 15:41:51 +13:00
Amelia Cordwell 0f170a9a32 Add Notification Panel
- List view of all notifications (will be split into acknowleged and
  unacknowledged)
- Detail view of each notification
- Acknowledge notifications
- Error notifications show up in red

Change-Id: I0800201b42424bfdd3f27dd090502f28e4f54227
2018-02-13 13:21:57 +13:00
Adrian Turjak d6c7521925 fix a divide by zero bug
Change-Id: If6d8d545eedc284177cd995423453a9589dee46e
2018-01-24 17:59:28 +13:00
Jonathan Herlin 5d6427d44e "Management" had a spelling error, this commit adds the missing character.
Change-Id: Ie343adbae65389a6d802556ff86c9aff51d81943
2017-11-30 21:16:39 +01:00
Adrian Turjak 6620e0c8f0 quota panel fixes
* wrong policy in panel
* shift text to below current sizes
* add * for clarify preapproved quotas

Change-Id: I31f2ad99847236b327ec7d51d4feeca4e2de3569
2017-09-14 16:43:18 +12:00
Amelia Cordwell 519c30d185 Quota Update Panel
Allows viewing of current quota value, quota sizes and percentage
of use of current quota.
Allows changing of each region's quota.

Change-Id: Ia9f254ffb905b4e8971d84f85aefad164e8a3438
2017-09-12 20:42:16 +12:00
Amelia Cordwell 502e6db24d Logout_status instead of logout_reason_class
* Ensures that on logouts indicating success (eg after a password
  change) the reason message is highlighted in green rather than
  red

Change-Id: I0af763975338733ded792755ffac48614aa6f8c1
Closes-Bug: #1708475
2017-09-07 05:46:34 +00:00
Amelia Cordwell b752f12121 Fixes for Django 1.10 compatabililty
* Removed {% load url from future %}, deprecated in 1.7 removed
in 1.9. See [1]
* Removed urlpatterns() from url file. Deprecated 1.8 removed
1.10. See [2]
* django 1.9+ overextends builtins need adding to settings,
  but 1.10+ we can use native django features. Will remove
  overextends when we drop support for anything less than django 1.11

[1] https://docs.djangoproject.com/en/1.9/releases/1.7/#loading-ssi-and-url-template-tags-from-future-library
[2] https://docs.djangoproject.com/en/1.10/releases/1.8/#django-conf-urls-patterns

Change-Id: Ief7dc4d5025284b0fc26a6386c1c41e0d701fe23
2017-09-07 17:04:39 +12:00
adrian-turjak 8ef5ca240a Fix a template rename issue with signup templates
Change-Id: Ieaf1ac3c5f0716222cc2565f42d6cb6a77f28e11
2017-05-31 22:38:19 +12:00
adrian-turjak d7a8631176 Remove Catalyst specific line from templates.
* Leftovers from the split into a plugin.

Change-Id: I834b686f9c280a95380378ea49e703a884866d64
2017-05-31 17:38:24 +12:00
Amelia Cordwell dfa0388152 Signup Panel
* Accessible at /signup/
* Link placed on bottom of login page.
* Submits a simple signup request to Adjutant.
* Added overextends to based Adjutant enabled file.
* Added back button to match login form to forgot password.
* Change forgot password to match signup autofocus logic.

Change-Id: I1628495a3c35186a45061d07d5e392dc63121ee9
2017-05-25 20:06:40 +12:00
adrian-turjak 490a16c08b Rename panel to Admin Tasks
* This is mainly to match other places such as the cli tool
  where we will refer to these as 'admin tasks' to differentiate
  from Mistral tasks.

Change-Id: I23b65e82d640d6a26e3b44a1d5bcce7e49321071
2017-05-24 20:49:17 +12:00
adrian-turjak 3321bf3fb4 Approval should warn with a pop-up
* Making it so that approving a task requires a confirmation.

Change-Id: Ic82a9be97c167dc5d33ae6630381a5c9af27b215
2017-05-24 20:40:06 +12:00
Amelia Cordwell 901a0d7a2e Added Reissue token and Rerun Validation action
Reissue token is an option for approved tasks, and rerun validation
is an option for active tasks that have not yet been approved and
invalid.

Change-Id: I0147c31ffbc1a003dfb143adf09b75949eba7c58
2017-05-24 20:17:29 +12:00
adrian-turjak 0d8384a5f2 Actions in detail view not working when approved
* Due to the batch actions looking in the table for the actions
  the action would fail because tasks in the approved state
  would not be present in the default active table.
* Adding a condition to get the correct table actions.

Change-Id: Iac75ecc5ce91952e0f26746045113024aad6cbb2
2017-05-24 15:49:22 +12:00
Amelia Cordwell 588a15bdbd Panel and Token Handler for update email
Adds a panel in the settings dashboard to allow the user to change
their email address, and a token handler for that page.

Change-Id: I4991fa599f6cfbf65f143e5b2227867df6fb86c3
2017-05-24 12:57:11 +12:00
adrian-turjak f8d53b3a12 Renaming StackTask to Adjutant
* This is just a search and replace.
* No functional changes.

Change-Id: Id03ae0cb572df127a590e2631c3fb4888b34ac84
2017-05-17 15:07:34 +12:00