Migrate Zuul jobs to openstack/openstack-chef

Change-Id: Ica4deecd2dfb9029d24c8ebb2f3f2720291914e7
This commit is contained in:
Samuel Cassiba
2018-08-31 23:33:28 -07:00
parent edcad9fdb7
commit 8113631678
8 changed files with 44 additions and 11 deletions

5
.gitreview Normal file
View File

@@ -0,0 +1,5 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/cookbook-openstackclient.git
defaultbranch=stable/ocata

View File

@@ -1,11 +1,16 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2016-08-29 21:29:34 +0200 using RuboCop version 0.39.0.
# on 2018-09-01 16:19:31 -0700 using RuboCop version 0.47.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 20
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/BlockLength:
Max: 194
# Offense count: 7
Style/Documentation:
Exclude:

3
.zuul.yaml Normal file
View File

@@ -0,0 +1,3 @@
- project:
templates:
- openstack-chef-jobs

View File

@@ -1,4 +1,4 @@
# encoding: UTF-8
#
# Copyright 2016 cloudbau GmbH
#

View File

@@ -1,4 +1,4 @@
# encoding: UTF-8
#
# Copyright 2016 cloudbau GmbH
#
@@ -16,7 +16,7 @@
task default: ['test']
task test: [:lint, :style, :unit]
task test: %i(lint style unit)
desc 'Run FoodCritic (lint) tests'
task :lint do

View File

@@ -80,16 +80,22 @@ module OpenstackclientCookbook
user = connection.users.find { |u| u.name == user_name }
domain = connection.domains.find { |p| p.name == domain_name }
role = connection.roles.find { |r| r.name == role_name }
connection.grant_domain_user_role(
domain.id, user.id, role.id) if role && domain && user
if role && domain && user
connection.grant_domain_user_role(
domain.id, user.id, role.id
)
end
end
action :revoke_domain do
user = connection.users.find { |u| u.name == user_name }
domain = connection.domains.find { |p| p.name == domain_name }
role = connection.roles.find { |r| r.name == role_name }
connection.revoke_domain_user_role(
domain.id, user.id, role.id) if role && domain && user
if role && domain && user
connection.revoke_domain_user_role(
domain.id, user.id, role.id
)
end
end
end
end

View File

@@ -1,4 +1,4 @@
# encoding: UTF-8
#
# Copyright 2016 cloudbau GmbH
#
@@ -17,10 +17,15 @@
name 'openstackclient'
maintainer 'cloudbau GmbH'
maintainer_email 'j.klare@cloudbau.de'
license 'Apache v2.0'
license 'Apache-2.0'
description 'Installs the fog-openstack gem and offers LWRPs to use it'
issues_url 'https://github.com/cloudbau/cookbook-openstackclient/issues'
source_url 'https://github.com/cloudbau/cookbook-openstackclient'
chef_version '>= 12.5' if respond_to?(:chef_version)
version '15.0.1'
gem 'fog-openstack'
%w(ubuntu redhat centos).each do |os|
supports os
end
gem 'fog-openstack', '<0.2.0'

View File

@@ -23,4 +23,13 @@ RSpec.configure do |config|
config.log_level = :error
end
REDHAT_OPTS = {
platform: 'redhat',
version: '7.3'
}.freeze
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '16.04'
}.freeze
at_exit { ChefSpec::Coverage.report! }