Skip to content

Commit efda66b

Browse files
committed
fix some cookstyle warning. add Khosrow as contributor
1 parent 02eb6cd commit efda66b

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ cloudstack Cookbook
44
Install and configure [Apache Cloudstack](http://cloudstack.apache.org) using [Chef](http://www.chef.io/). A wrapper cookbook is prefered in order to Install Apache CloudStack properly, refer to [cloudstack_wrapper cookbook](https://github.com/cloudops/cookbook_cloudstack_wrapper) for example.
55

66

7+
Work with Chef 12 only.
8+
79
Tested on CentOS 7 and Ubuntu 16.04
810

911

@@ -204,7 +206,8 @@ e.g.
204206

205207
License and Authors
206208
-------------------
207-
- Author:: Pierre-Luc Dion (<[email protected]>)
209+
- Author:: Pierre-Luc Dion (<[email protected]>)
210+
- Author:: Khosrow Moossavi ([email protected])
208211

209212
Some snippets have been taken from: [schubergphilis/cloudstack-cookbook](https://github.com/schubergphilis/cloudstack-cookbook)
210213
- Author:: Roeland Kuipers (<[email protected]>)
@@ -213,7 +216,7 @@ Some snippets have been taken from: [schubergphilis/cloudstack-cookbook](https:/
213216

214217

215218
```text
216-
Copyright:: Copyright (c) 2015 Author's
219+
Copyright:: Copyright (c) 2018 CloudOps Inc.
217220
218221
Licensed under the Apache License, Version 2.0 (the "License");
219222
you may not use this file except in compliance with the License.

libraries/system_template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
module Cloudstack
2222
module SystemTemplate
2323
# retrieve template ID from database
24-
def get_template_id
24+
def db_template_id
2525
# get template ID from database to check path
2626
Chef::Log.debug 'Retrieve template ID from database'
2727
template_cmd = "mysql -h #{@current_resource.db_host} --user=#{@current_resource.db_user} --password=#{@current_resource.db_password} --skip-column-names -U cloud -e 'select max(id) from cloud.vm_template where type = \"SYSTEM\" and hypervisor_type = \"#{@current_resource.hypervisor}\" and removed is null'"

providers/api_keys.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@ def whyrun_supported?
4040

4141
action :create do
4242
wait_count = 0
43-
until cloudstack_api_is_running? || wait_count == 5 do
43+
until cloudstack_api_is_running? || wait_count == 5
4444
cloudstack_api_is_running?
4545
sleep(5)
4646
wait_count += 1
47-
if wait_count == 1
48-
Chef::Log.info 'Waiting CloudStack to start'
49-
end
47+
Chef::Log.info 'Waiting CloudStack to start' if wait_count == 1
5048
end
5149

5250
create_admin_apikeys

providers/global_setting.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def load_current_resource
5757
if @current_resource.admin_apikey.nil?
5858
Chef::Log.error 'admin_apikey empty, cannot update Global Settings'
5959
else
60-
client = CloudstackRubyClient::Client.new('http://localhost:8080/client/api/', @current_resource.admin_apikey, @current_resource.admin_secretkey, false)
6160
current_value = load_current_value(@current_resource.name)
6261
if current_value.nil?
6362
Chef::Log.error "Global Setting: #{@current_resource.name} not found"

providers/system_template.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def load_current_resource
5858
cmd.error!
5959
@current_resource.url(cmd.stdout.chomp)
6060
end
61-
template_id = get_template_id
61+
template_id = db_template_id
6262
Chef::Log.debug "looking for template in #{@current_resource.nfs_path}/template/tmpl/1/#{template_id}"
6363
if ::File.exist?("#{@current_resource.nfs_path}/template/tmpl/1/#{template_id}/template.properties")
6464
Chef::Log.debug "template exists in #{@current_resource.nfs_path}/template/tmpl/1/#{template_id}"

0 commit comments

Comments
 (0)