resource_in 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +2 -0
- data/build.mk +2 -2
- data/lib/resource_in/command.rb +2 -2
- data/lib/resource_in/config.rb +14 -2
- data/lib/resource_in/driver_racktables.rb +0 -2
- data/lib/resource_in/version.rb +1 -1
- data/resource-in.gemspec +1 -1
- data/tmp/config.example +21 -0
- data/tmp/testrc +5 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26fa0d6fc3854520c3498b2f7fedcca03fe9adf5
|
4
|
+
data.tar.gz: f27754bb3fa96d6ee23c5fa24cc52c5166dd5970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a44b48a273e136970f8e3570f74ed534e9dee89df837dc56c6ce5236821b7484b8f1a0e8fd12765d88b2d4243bf056a01f81e4440e39bb077cd149a76a51106f
|
7
|
+
data.tar.gz: 988d2fb229ad6eab3bd77918abc81a70436147dd74d5bbb21cdf2efa848ad8565023e32c067007cd5319b318e3258e4325a7d36ea4e648ef4749bba7073b1e07
|
data/.gitignore
CHANGED
data/README.md
CHANGED
data/build.mk
CHANGED
@@ -9,12 +9,12 @@ clean:
|
|
9
9
|
[ -d ./build ] && sudo rm -fR ./build || true
|
10
10
|
|
11
11
|
ucs-build:
|
12
|
-
sudo apt-get install python2.7
|
12
|
+
sudo apt-get -y install python2.7 python-pip python-dev
|
13
13
|
wget https://communities.cisco.com/servlet/JiveServlet/download/36899-13-76835/UcsSdk-0.8.3.tar.gz -O build/UcsSdk-0.8.3.tar.gz
|
14
14
|
tar xzf build/UcsSdk-0.8.3.tar.gz -C build
|
15
15
|
cd build/UcsSdk-0.8.3/; /usr/bin/python setup.py build && sudo /usr/bin/python setup.py install
|
16
16
|
|
17
17
|
vmware-build:
|
18
|
-
sudo apt-get install python3 python3-pip git
|
18
|
+
sudo apt-get -y install python3 python3-pip git
|
19
19
|
git clone https://github.com/vmware/pyvmomi.git build/pyvmomi
|
20
20
|
cd build/pyvmomi/; /usr/bin/python3 setup.py build && sudo bash -lc "/usr/bin/python3 setup.py install"
|
data/lib/resource_in/command.rb
CHANGED
@@ -6,7 +6,7 @@ require 'terminal-table/import'
|
|
6
6
|
module ResourceIn
|
7
7
|
class Command
|
8
8
|
def self.list(opts, argv)
|
9
|
-
unless Authorization.is_viewer?
|
9
|
+
unless !!Config['ignore-auth'] or Authorization.is_viewer?
|
10
10
|
puts "[Warning] User '#{ENV['USER']}' needs 'Viewer' permission to execute command 'list'"
|
11
11
|
return
|
12
12
|
end
|
@@ -29,7 +29,7 @@ module ResourceIn
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
def self.get(opts, argv)
|
32
|
-
unless Authorization.is_user?
|
32
|
+
unless !!Config['ignore-auth'] or Authorization.is_user?
|
33
33
|
puts "[Warning] User '#{ENV['USER']}' needs 'User' permission to execute command 'get'"
|
34
34
|
return
|
35
35
|
end
|
data/lib/resource_in/config.rb
CHANGED
@@ -6,13 +6,25 @@ module ResourceIn
|
|
6
6
|
|
7
7
|
class << self
|
8
8
|
def [](param)
|
9
|
-
(@config_data ||= load_config)
|
9
|
+
unless (@config_data ||= load_config).key? 'resource-in'
|
10
|
+
return nil
|
11
|
+
end
|
12
|
+
|
13
|
+
unless @config_data['resource-in'] != nil
|
14
|
+
return nil
|
15
|
+
end
|
16
|
+
|
17
|
+
unless @config_data['resource-in'].key? param
|
18
|
+
return nil
|
19
|
+
end
|
20
|
+
|
21
|
+
@config_data['resource-in'][param]
|
10
22
|
end
|
11
23
|
|
12
24
|
private
|
13
25
|
def load_config
|
14
26
|
unless FileTest.exists?(config_path)
|
15
|
-
raise RuntimeError
|
27
|
+
raise RuntimeError.new("invalid configuration file (#{config_path})")
|
16
28
|
end
|
17
29
|
|
18
30
|
YAML.load_file(config_path)
|
data/lib/resource_in/version.rb
CHANGED
data/resource-in.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_runtime_dependency "terminal-table", "1.5.2"
|
22
22
|
spec.add_runtime_dependency "colorize", "0.7.7"
|
23
|
-
spec.add_runtime_dependency "dl_racktables", "~> 0.0.
|
23
|
+
spec.add_runtime_dependency "dl_racktables", "~> 0.0.2"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.11"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
data/tmp/config.example
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# configuration for UCS managers
|
2
|
+
ucs:
|
3
|
+
- server: 'Hostname or IP address of UCS Manager'
|
4
|
+
userid: 'Login userid of UCS Manager'
|
5
|
+
passwd: 'Password of UCS Manager'
|
6
|
+
|
7
|
+
# configuration for VMware
|
8
|
+
vmware:
|
9
|
+
- server: 'Hostname or IP address of vCenter'
|
10
|
+
userid: 'Login userid of vCenter'
|
11
|
+
passwd: 'Password of vCenter'
|
12
|
+
|
13
|
+
# configuration for Racktables
|
14
|
+
racktables:
|
15
|
+
server: '203.209.146.68' # IPAddress of Racktables
|
16
|
+
userid: 'Login userid of Racktables'
|
17
|
+
passwd: 'Password of Racktables'
|
18
|
+
|
19
|
+
# This parameter is usefull for development
|
20
|
+
resource-in:
|
21
|
+
ignore-auth: true
|
data/tmp/testrc
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resource_in
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroyasu OHYAMA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: terminal-table
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.0.
|
47
|
+
version: 0.0.2
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.0.
|
54
|
+
version: 0.0.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,6 +124,8 @@ files:
|
|
124
124
|
- lib/resource_in/resource.rb
|
125
125
|
- lib/resource_in/version.rb
|
126
126
|
- resource-in.gemspec
|
127
|
+
- tmp/config.example
|
128
|
+
- tmp/testrc
|
127
129
|
homepage: https://github.com/userlocalhost2000/resource-in
|
128
130
|
licenses: []
|
129
131
|
metadata: {}
|