Commit Graph

42 Commits

Author SHA1 Message Date
Henrique Santos bd26a63da9 Fixes user and project search by name in openstack_user resource
As project and user names are only unique for each domain and some
Keystone settings may filter user listing, any user or project search by
name needs to include the associated domain.

This change fixes any search done by name of a project or user in the
openstack_user resource. It is
assumed that if no domain is specified and there are multiple elements
with the same name, the first search result is
chosen.

Closes-Bug: #1871144

Change-Id: I0ed3ffabab5f8b0959c3b2c50a3619f378e59c9e
Signed-off-by: Henrique Santos <hfigueiredosantos@tecnico.ulisboa.pt>
2020-06-01 17:36:00 -07:00
OpenDev Sysadmins 5f386c5d2c 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:30:14 +00:00
Roger Luethi d3ac8043f5 Pin fog-openstack to 0.3.4
With 0.3.5, fog-openstack changes the way it handles versioned identity
endpoints, resulting in errors such as:

  Excon::Error::NotFound: openstack_domain[default]
  (openstack-identity::registration line 69) had an error:
  Excon::Error::NotFound: Expected([200, 201]) <=> Actual(404 Not Found)
  excon.error.response
    :body          => "{\"error\": {\"message\":
    \"(http://127.0.0.1:35357/v3/auth/tokens/v3/auth/tokens): The resource
    could not be found.\", \"code\": 404, \"title\": \"Not Found\"}}"
    :cookies       => [
    ]
    :headers       => {
      "Content-Length"         => "149"
      "Content-Type"           => "application/json"
      "Date"                   => "Fri, 28 Sep 2018 06:27:48 GMT"
      "Server"                 => "Apache"
      "Vary"                   => "X-Auth-Token"
      "X-Distribution"         => "Ubuntu"
      "x-openstack-request-id" => "req-bc3aed4d-a4f2-4224-8aef-c675387d3a27"
    }
    :host          => "127.0.0.1"
    :local_address => "127.0.0.1"
    :local_port    => 42372
    :path          => "/v3/auth/tokens/v3/auth/tokens"
    :port          => 35357
    :reason_phrase => "Not Found"
    :remote_ip     => "127.0.0.1"
    :status        => 404
    :status_line   => "HTTP/1.1 404 Not Found\r\n"

Change-Id: Icfb0cd289ed62e7433cc1ee2341a70d649fc6aa0
(cherry picked from commit 876cb832c2)
2018-09-28 11:43:28 +02:00
Samuel Cassiba 7fa537683d
Pin fog-openstack to 0.3
The breaking changes of 0.3.1 have been reverted in 0.3.2 and the
changes have been reintroduced in 1.0.0.

Change-Id: I3bb53ef37a0a505adf5c06bf501f3f100632e21d
2018-09-21 09:31:48 +00:00
Roger Luethi f9ffe858c9 Pin fog-openstack to < 0.3.0
With 0.3.1, fog-openstack renames much of its API, resulting in
errors such as:

  openstack_domain[default] (openstack-identity::registration line 69) had
  an error: NameError: uninitialized constant Fog::Identity::OpenStack

Let's stay below 0.3 for now.

Change-Id: Id3e9e6d8560ef5ffd9d28eedc0a2494722a2878f
(cherry picked from commit 0664bf2935)
2018-09-20 04:42:11 +00:00
Samuel Cassiba 5a08a0fc0a bump fog-openstack to fixed version which contains deprecation messages
This reverts commit 6ff248d681.

Change-Id: I83fb8960e9a651ebc800fab3f3cc33cc7b2635ae
2018-09-10 08:12:25 +00:00
Samuel Cassiba b85049a93a Revert "bump fog-openstack to fixed version which contains deprecation messages"
This reverts commit 5483486891.

Change-Id: I29850570cf29caf950e48fbd5dc814efaa62c12d
2018-09-04 17:29:22 +00:00
Jan Klare 5483486891 bump fog-openstack to fixed version which contains deprecation messages
Change-Id: Iee7025b56ab1f3a48a5828743ead080ac401605c
2018-09-04 09:50:46 +00:00
Zuul 2e6de7180f Merge "Pin fog-openstack library to avoid breakage" into stable/queens 2018-09-01 17:48:16 +00:00
Samuel Cassiba 5e36c32ba8 Migrate Zuul jobs to openstack/openstack-chef
Change-Id: Ifc68f130ad74a4ff35a54247e5251a0aaca2910e
2018-08-31 23:24:12 -07:00
Roger Luethi 19ce6f6bf3 Pin fog-openstack library to avoid breakage
The update of the fog-openstack ruby gem from 0.12.7 to 0.2.0 breaks
Chef recipes. The first call to cookbook-openstackclient from
cookbook-openstack-identity:recipes/registration.rb fails already with
something like (extract from a kitchen run of openstack-chef-repo):

  ERROR: openstack_domain[default] (openstack-identity::registration line 69)
  had an error: Fog::Identity::OpenStack::NotFound: Expected([200]) <=>
  Actual(404 Not Found)

  (http://127.0.0.1:35357/v3/v3/domains): The resource could not be found.

Change-Id: I4d30cb1770b6774b39bfd4e4c413f25816b405df
(cherry picked from commit 7ae001c6c4)
2018-08-31 07:31:39 +00:00
Samuel Cassiba a8f531997a stable/queens release patch
Change-Id: Id1c74cf1a103176d3e1283041457c28ca9cdeae6
2018-07-26 22:37:50 -07:00
Samuel Cassiba 7dffaaa416 Remove .zuul.yaml for import 2018-05-31 08:17:54 -07:00
Samuel Cassiba f91304ec17 Add .gitreview file 2018-05-28 09:11:21 -07:00
Samuel Cassiba bfd132d5dc Style and lint fixes, add helpers
- add delivery and zuul configs
- prepare cookbook for inclusion in OpenStack
2018-05-28 09:05:53 -07:00
Samuel Cassiba 6391057a3c Update metadata for migration to OpenStack 2018-04-21 19:09:22 -07:00
Jan Klare aa3e7271e1
starting queens development patch 2018-03-06 10:01:23 +01:00
Jan Klare cf1bf525a5
Merge pull request #8 from scassiba/chef13_fixups
fix more resource collisions
2018-02-20 13:46:22 +01:00
Samuel Cassiba 15c451bc12 fix more resource collisions 2018-02-16 12:53:20 -08:00
Jan Klare 332f73217b
Merge pull request #7 from scassiba/master
Fixups for Chef 13+ for Pike
2018-02-12 17:12:06 +01:00
Samuel Cassiba 50b07b156a Aggressively undeprecate legitimate method calls 2018-02-12 08:04:51 -08:00
Samuel Cassiba dea8e2d18e Fix endpoint interface handling 2018-02-12 07:41:50 -08:00
Samuel Cassiba a48eb7cca2 Refer to property_name as new_resource.property_name
In Chef 14, the short form of property_name is removed, in favor of
new_resource.property_name.[0]

[0] https://docs.chef.io/deprecations_namespace_collisions.html
2018-02-12 07:41:50 -08:00
Samuel Cassiba 0b343d3c1b Fix metadata and LICENSE for foodcritic 2018-02-12 07:41:50 -08:00
Jan Klare 1df4fb87ba
update travis ci config with newes chefdk and adapt to cookstyle
* this is a preparation step for fully updation to chef13 (see also PR #7 for more updates)
2018-02-12 13:13:40 +01:00
Jan Klare 6472457e51
version bump to align with upstream 2017-11-23 15:49:28 +01:00
Jan Klare 00db69eaa9
Merge pull request #4 from ideaship/grant_domain_04
Grant domain
2017-11-13 23:22:41 +11:00
Roger Luethi 049eb35d46 Use user model for grant_domain, revoke_domain
Unlike the rest of the library, openstack_user's grant_domain and
revoke_domain actions bypass the fog models and call directly into the
requests. It works, but it is inconsistent and confusing.

This patch uses user.grant_role instead of directly calling
connection.grant_domain_user_role. Likewise for revoke_domain.
2017-11-10 17:03:03 +01:00
Roger Luethi ae02bdc632 Remove superfluous arguments for grant_domain, revoke_domain
The project_name argument is ignored by openstack_user's grant_domain
and revoke_domain actions. This patch removes them from the test recipe.
2017-11-10 17:03:03 +01:00
Roger Luethi 15781eac4e Add platform, version to spec files
This patch adds platform and version to the spec files. Without it,
every single test results in this warning:

WARNING: you must specify a 'platform' and 'version' to your ChefSpec Runner and/or Fauxhai constructor, in the future omitting these will become a hard error. A list of available platforms is available at https://github.com/customink/fauxhai/blob/master/PLATFORMS.md
2017-11-10 17:03:00 +01:00
Roger Luethi 97239e41a9 Add comments to openstack_user.rb
The new comments try to clarify the purpose of the ":grant_domain"
action of the openstack_user resource.

In contrast to what the name may suggest, the action does not grant a
domain (which is not possible). Instead, it grants a role to a user who
is already in a specific domain. The domain attribute is merely used to
identify the user.
2017-11-02 15:28:09 +01:00
Roger Luethi bfafac1d99 Allow user creation in domain other than default
For reasonably recent OpenStack releases, users are always created in a
domain (by default in the aptly named 'Default' domain). With this
patch, a new domain name attribute can be passed to the openstack_user's
:create action in order to create a user in a specific domain.
2017-11-02 15:28:09 +01:00
Jan Klare 44a257fd4b Merge pull request #3 from howardabrams/master
Specify the default tenant during user create
2017-04-12 11:02:07 +02:00
Howard Abrams 03fbe7b7a3 Specify the default tenant during user create
If the project tenant is given when creating the user account,
honor it by assigning that as the _default_ project tenant.

This is especially helpful when creating initial service accounts and
assigning them to the `service` project).
2017-04-11 14:38:58 -07:00
Jan Klare 57e59b64e4 Merge pull request #2 from cloudbau/fix_grant_user_domain_role
Fixed function grant_user_domain_role
2016-09-30 12:17:57 +02:00
Christoph Albers d2b5bf7c37 Fixed function grant_user_domain_role
- method is from top level class (not domain itself)
- fixed specs
2016-09-30 12:08:13 +02:00
Jan Klare a65b0a3951 Merge pull request #1 from cloudbau/fix_openstack_base_lib
minor fix for openstack_base lib since new_resource was used in wrong
2016-09-26 17:51:28 +02:00
Jan Klare e22f838e0f minor fix for openstack_base lib since new_resource was used in wrong
context
2016-09-26 17:35:43 +02:00
Jan Klare 7daa8f458b added chef-client dependency 2016-08-30 10:15:03 +02:00
Jan Klare f7dd6cbc63 fixed README formatting 2016-08-30 10:08:42 +02:00
Jan Klare 12b5e233c2 added .travis.yml for automated testing 2016-08-30 09:59:56 +02:00
Jan Klare e86f258f5a initial commit
* working Rakefile to run lint, style and unit tests
* providers for domain, endpoint, project, role, service and user
* some initial README info
2016-08-30 09:44:21 +02:00