Commit Graph

244 Commits

Author SHA1 Message Date
OpenDev Sysadmins 5dbb06cb65 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:27:57 +00:00
Doug Hellmann 49d3b6f459 import zuul job settings from project-config
This is a mechanically generated patch to complete step 1 of moving
the zuul job settings out of project-config and into each project
repository.

Because there will be a separate patch on each branch, the branch
specifiers for branch-specific jobs have been removed.

Because this patch is generated by a script, there may be some
cosmetic changes to the layout of the YAML file(s) as the contents are
normalized.

See the python3-first goal document for details:
https://governance.openstack.org/tc/goals/stein/python3-first.html

Change-Id: Ib10e1adfa6f0f6329ad310d6d7d40cc90d754312
Story: #2002586
Task: #24284
2018-08-31 07:55:07 -04:00
Doug Hellmann 45351187f4 fix the project setting in .gitreview
Change-Id: Iad5c659e044b65230b37ac02c48ab61dd70361e7
Story: #2002586
Task: #24284
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-08-22 08:23:55 +00:00
Adrian Turjak 56f8fc1426 Fix tox.ini cover job for zuul
Change-Id: I0711c836acec0bea9fbee12a8935f2ef321f2edd
2018-08-22 18:11:59 +12:00
Amelia Cordwell 5e16b575ad Additional Tests for Notification, Token and Email
Change-Id: I57f1df7790fd258ea1b5b9365b15816872941b3a
2017-09-01 15:26:29 +12:00
Jenkins 1600a7bdf6 Merge "Reapprove now clears old tokens" 2017-09-01 01:45:05 +00:00
Jenkins 27ec9402c5 Merge "Task Type in Token response" 2017-08-15 00:11:46 +00:00
Jenkins 4942139287 Merge "Notifications in views.py now set error correctly" 2017-08-14 23:43:32 +00:00
Amelia Cordwell f13fc00f3e Notifications in views.py now set error correctly
While the notifications there are error messages they were not
noted down as such previously.

Change-Id: If831fdbd6686dd9a42f33828c4bf69f53028e300
2017-07-27 12:46:17 +12:00
Amelia Cordwell 5d287f101b Reapprove now clears old tokens
See launchpad bug #1702217

Change-Id: I9858fdd2c4eef46cb3e7eb3b5da219936bd6c248
2017-07-12 14:05:44 +12:00
ritesh.arya 18ad055616 Replace six.iteritems() with .items()
1.As mentioned in [1], we should avoid usingg
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable.
2.In py2, the performance
about list should be negligible, see the link [2].
[1]
https://wiki.openstack.org/wiki/Python3
[2]
http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I19adc9253ce874205d12a5b5430818cbf94ed29c
2017-07-11 04:20:40 +00:00
adrian-turjak 4dadabd13d Quota setting shouldn't have to be required
* This is part of a larger issue that needs to be addressed
  but for now just fixing this gets around the problem I'm
  running into.

Change-Id: I0b4d7897293708181e21d9b5ef473f257bdf7f5c
2017-06-29 17:26:30 +12:00
Amelia Cordwell 0daad8c4eb Task Type in Token response
Change-Id: I9ae9a3f464a27b7d862b0890704b36d5cb5ef813
2017-06-27 09:41:55 +12:00
Amelia Cordwell 13cec7cf5e Remove RT Notification code
* Fixes python3 compatability.
* See bug #1699663

Change-Id: I6eab9f3632681c6b765def297d4ad083770ade25
2017-06-22 17:24:40 +12:00
adrian-turjak c17320c069 Update test files for openstack-infra
* also update the gitreview file
* add base doc folder for future use (and to make
  CI happy)

Change-Id: Ifd854682c8121720e940c0a7d8ac3656cbf97af0
2017-06-21 16:18:37 +12:00
Amelia Cordwell bd226c46d8 Check action validity on submit before returning
If an action becomes invalid after during submit,
currently a user will get an OK response and an email stating the
completion of the action.

Now returns 400 in this case and does not send the email.

Change-Id: I4b998742cd2dfbafd40ff277a68ce9aca45b7872
2017-06-16 15:56:19 +12:00
Amelia Cordwell 09ce93f5b7 Additional tests for project actions
* A few slight changes that threw errors during the tests
* Adds a coveragerc file which ignores a few common things that
  will not be tested

Change-Id: I5c3604783dce67585ba3592e723649707549b65a
2017-06-16 15:52:16 +12:00
Amelia Cordwell a46b101cc2 Fix and tests for modify_dict_settings
The update command of modify_dict_settings wasn't working due to
the main reset operation being to override the whole dict and not
update pointers. This has been fixed.

Additionally some basic tests the modify_dict_settings have been
added, which are more explicit.

Change-Id: I52e2157a7faeb6c4a95a06f40209aa3642d0e76c
2017-06-16 12:16:10 +12:00
Amelia Cordwell f7c62e5a87 Python3 Compatibility
Slight changes to ensure python3 compatibility, and tox running
with python3.

Change-Id: Ibe017a0f68e3779f199a56165d401cda876f710a
2017-06-15 16:23:01 +12:00
Amelia Cordwell f6ee662631 Added basepython to coverage tests
Different versions of tox default to different base versions of
python for coverage tests.

This ensures it uses python2.7.

Change-Id: I6137c43b6383909498efae45a197ef05fc00a026
2017-05-31 14:58:33 +12:00
adrian-turjak 818fc97976 Add note to devstack guide about USERNAME_IS_EMAIL
Change-Id: I23776049864cf4b23c188607cd92eb2a32fbabcf
2017-05-31 01:34:48 +12:00
adrian-turjak c55071fe9a Updating keystone url to be correct for master devstack
Change-Id: Idcef829db4fda417097b7eba78d2229e867ceaef
2017-05-31 00:48:25 +12:00
adrian-turjak 738ecb689d Fix keystone v2 command in devstack guide
Change-Id: I40b087715f7ba436dcff9043ac29e8d3e9b94fa7
2017-05-30 11:40:11 +12:00
adrian-turjak 467cc4683c Add note about public networks to devstack guide
Change-Id: I12baf5d39c3b62a06baa01ad37cc1ce280d519f0
2017-05-29 18:15:58 +12:00
adrian-turjak 0a8e94d065 Version 0.2.2
Change-Id: I5dd48b43b66d5cc5f7bd53a66a0abb8e61a9d3d8
2017-05-29 16:49:21 +12:00
adrian-turjak 3da809bfaa Adding support for code coverage reposting in tests.
Change-Id: I6e379747d347fc6b3d2fef00a711ae13bb62dfc5
2017-05-29 15:57:30 +12:00
adrian-turjak 3a35e66a66 Updating the docs to match current state
* While the incode documentation has been updated quite
  a bit, the readme has remained mostly untouched for too
  long and needed some updates.
* Also added some notes about deprecation of older style
  taskviews that ended up never being used in production
  anyway.

Change-Id: I7f21b68e1e37fec0bcba75eeccc35213c4e0a5c0
2017-05-29 12:57:42 +12:00
adrian-turjak dba11b87d1 Slightly saner default duplicate policies
* In most cases other than signup cancelling a duplicate
  is fairly safe, and better UX.

Change-Id: I5c154b649513d84b92821bdd60efa8fdab070dea
2017-05-25 16:57:36 +12:00
adrian-turjak 3cbe9b618e Update templates for token reissue case
* When a token is reissued actions aren't rerun and task cache
  values do not persist beyond runs (we may need to rethink that).
* This simply adds default causes for those token templates.

Change-Id: I004a2c1aac05aa5e9079b71b819f6f1dfa4bc565
2017-05-24 20:15:15 +12:00
adrian-turjak 7ea3d2bd35 Fix issue with network creation and reapproval
* Once the interface is created, it shouldn't happen again
  in the event of a rerun. Storing a flag now to avoid check
  and skip if done already.

Change-Id: I71808b4e79889b6d3bd397d4fec459e7f9f07909
2017-05-24 16:42:31 +12:00
adrian-turjak ca21dabdf8 Fix bug with signups and disabled users
* Token field for password was not being set.
* Have also added to test to confirm this.

Change-Id: I5e9c21ee4675181f21a889bfe7187995db05576a
2017-05-23 21:47:17 +12:00
adrian-turjak f1f0a6d87b Fixing some minor email templating issues
* Properly handling the spacing issues in some email templates.
* Adding proper cache values as needed by default templates in action
  so they are set properly, and also work for reapproval.

Change-Id: I3c8f9ffce3618b9a32464efa463c3bbd57782c68
2017-05-23 21:36:53 +12:00
adrian-turjak be1a175dc4 Removing AddDefaultUsersToProjectAction from default conf
* While useful in some cases, this isn't really a standard
  thing most clouds will really do and shouldn't be a default
  in the example conf.

Change-Id: Ida6ef9f421749f9e83122cd4c838366ac6c84045
2017-05-23 20:24:32 +12:00
adrian-turjak 5fa7a4e57e update version and package name
* 'adjutant' is taken, so renaming the package to
  'python-adjutant'.
* This pypi package is needed for ease of testing plugins
  as they need to import core stacktask features to run tests.

Change-Id: I08f87ee2ab2ab7ae624cf24eae5801a857681737
2017-05-23 12:00:42 +12:00
adrian-turjak 51eda877f4 Fix class level settings modification
* Fixing issues with class level modification of
  settings file in tests.

Change-Id: I58d6d2d493ca8cd9f56947c0ec48f8c546ce1729
2017-05-22 18:52:45 +12:00
adrian-turjak eb4bc2c870 Adjutant version to 0.2.0
Change-Id: Iee9dec317473fc4f36e41416201b28fd80c9a4ae
2017-05-22 15:35:02 +12:00
adrian-turjak 3b97de609b Remove unused debian folder
* Removing an old folder related to packaging
  which is no longer used, and also specific
  to an old way Catalyst used to package the
  service.

Change-Id: I634c4ab7fd114bec51a1d1b74f67fcad02d5a9ae
2017-05-18 16:04:38 +12:00
adrian-turjak af986c28fc Renaming StackTask to Adjutant
* This patch is just a search and replace with minor tweaks.
* No functional changes, just renaming.

Change-Id: I103790be7c0cd9234545e25e21ab1768cb5eb131
2017-05-17 12:25:45 +12:00
Amelia Cordwell 829d6ac30e Added Update Email task and action
The task only allows the current user to update their own email
address, a confirmation email is sent to the new address before
the switch.

Change-Id: I62b169d262c6455ffec96bdb29e254279e973851
2017-05-16 18:17:25 +12:00
Amelia Cordwell 58ac750bcc Additional Emails - Additional Action
Currently set up as an additional action added to the task in the
configuration file. At each stage (corresponding to the current email
section lables) a template and subject can be specified detailing
the email to be sent. This will be sent to the users email address
or otherwise an override email address set from the task.

In the configuration sending to the users email address can be
turned off with the line
   email_current_user: false

Additionally an email can be sent out to a group of roles within
a project using:
  email_roles:
      - project_admin

Or to a number of specific emails:
  email_additional_addresses:
      - admin@example.org

Or to an address specified in the task cache
  email_in_task_cache: true

(Cache key "additional_emails")
Change-Id: I6d454bdfefb7549322fea6cf0c91fac76b5aa89a
2017-05-12 16:05:22 +12:00
adrian-turjak 890b154591 adding license file
Change-Id: Ifb727b4511176c60d10d02f7fbd18cb8f3259efb
2017-05-12 16:02:04 +12:00
adrian-turjak 7de53ea24a Fixing two bugs related to approval
* If roles not present in keystone, we throw and error
  while trying to handle an error.
* when data is empty we fail to return a useful error message.

Change-Id: I8572cf7ce35997cd7b5a38658a3e4eb26afe4941
2017-05-12 15:57:00 +12:00
Amelia Cordwell 13cb4716cd Pagination for Task List
Number of tasks per page can be specified in the get request,
but if not specified the endpoint will return all of them.

Change-Id: I524249bf7e9f16feba8c9beaeb66267ec7da874e
2017-05-08 13:24:16 +12:00
Amelia Cordwell 8880d0ae6b Invited user username shown rather than email
Currently even if USERNAME_IS_EMAIL=False and a username has been
specified the list of invited users will show the email as the
username, this changes it to display the username.

Change-Id: Id4491790e4035050df5be4b79cd22d60e0b03b65
2017-05-04 16:20:22 +12:00
Amelia Cordwell ed6bb16cd1 Additional tests for USERNAME_IS_EMAIL=False
Note that while all of the base stacktask codebase works with this
setting, not all of the client and horizon will work with it.

This is due to when the settings change a number of actions now
also require a username field to be filled in, and there isn't a
way for the clients to determine whether or not this is the case.

Change-Id: Ie91f7634b3686a1535af1c3344be217db5a80d15
2017-04-27 21:14:42 +12:00
adrian-turjak cf100fc804 Update requirements file
* Updated to reflect versions currently used
* Updated Django safely to newest LTS (1.11).
  All tests pass, and existing code has been
  maintained with deprecation notices in expectation
  of this upgrade.
* Redid the docs url because of a new version
  causing an odd 500 error and because the schema
  method wasn't being used properly.

Change-Id: I991f825941a240eea7a5e408a540bc38afdd91be
2017-04-21 16:05:45 +12:00
Amelia Cordwell bbc0f31062 Added modify_dict_settings test decorator
This decorator allows for modification of test settings that are
stored as dictionaries for that tests only without needing to
override the whole dictionary. It acts in a similar way to django's
in built override_settings, and modify_settings.

To be applied to a class the class must subclass StacktaskTestCase
or StacktaskAPITestCase. In those two classes settings can also
be modified using:

with self.modify_dict_settings(...):
	# code

Example Usage:
@modify_dict_settings(ROLES_MAPPING=[
		    {'key_list': ['project_mod'],
		    'operation': 'remove',
		    'value': 'heat_stack_owner'},
		    {'key_list': ['project_admin'],
		    'operation': 'append',
		    'value': 'heat_stack_owner'},
		    ])
or
@modify_dict_settings(PROJECT_QUOTA_SIZES={
		    'key_list': ['small', 'nova', 'instances'],
		    'operations': 'override',
		    'value': 11
		    })

Available operations:
Standard operations:
- 'override': Either overrides or adds the value to the dictionary.
- 'delete': Removes the value from the dictionary.

List operations:
List operations expect that the accessed value in the dictionary
is a list.
- 'append': Add the specified values to the end of the list
- 'prepend': Add the specifed values to the start of the list
- 'remove': Remove the specified values from the list

Change-Id: I575c17891d14418c335b2fb8426830e6e31be515
2017-04-20 14:13:46 +12:00
Amelia Cordwell 0ff277f208 Changes to fake openstack client and caches
Due to more of stacktask interacting with the clients querying
about usage and deletion, the fake openstack clients have to
be updated.

Neutron cache top level key is now a region name, with the
second level being a project id.

A number of additional functions have been added to fake nova
client and fake neutron client to allow the user to query usage.

Change-Id: I3859f298b3530abaf2dc59f61d57e464f8a8a7f4
2017-04-20 12:49:08 +13:00
Amelia Cordwell 607cc93d67 Added auto approval as part of actions
In actions pre-approve stage the function self.set_auto_approve()
can be called, to identify the action as one that is allowed to
be pre-approved. (True, False and None can be specified). If the
function has not been called when auto_approve is accessed it will
default to None. This is saved as a new attribute in the actions
model.

At the task layer before process_actions finishes, it checks to
see the status of it's actions auto_approve. If none of these are
False and at least one of them is True it will auto approve
if all of it's actions have auto_approve set to true, if so
instead of returning it it will run (and return the values of)
the approve function.

ResetPassword is the only pre-approved action that has not been
switched to this way, due to possible security implications, as
it would return 'actions invalid' if the user did not exist.

Change-Id: I678849d212b7e91de541120e0d70ddf08cf9b488
2017-04-20 09:00:54 +12:00
adrian-turjak 8a2f2f2107 better manageable roles
* A user cannot edit another user unless all target user
  roles are a subset of editor manageable roles, not just
  the roles that are being edited.
* User list now returns 'manageable' boolean to indicate
  if your logged in user can edit roles of the listed user.
* Fixing an issue with mocking and test code not actually
  returning correct values for 'user_list'.
* Editing ROLES_MAPPING in settings to match default conf.

Change-Id: I3720386b6dfe4465a50ded3e21b5b577f1340dbf
2017-04-19 19:10:06 +12:00