megam_api 0.7.7 → 0.7.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c54e02654f5842a8fe6a9f1db04ed43efa0f946d
4
- data.tar.gz: e7e176ae5e5e18b5c3ba256046db5f3d009414eb
3
+ metadata.gz: 6172ca6dcb996dd9f594003d8b07c2b4336aa53c
4
+ data.tar.gz: aa3b2084117a559559a46e8f251f1be7fb391677
5
5
  SHA512:
6
- metadata.gz: eca0464d3a66b7aaab19cb997ff16a98e9f3a032c71da3efa36fe42fd8ff4e3531aa5934c9baf066124e5b3202116e46e93b29c0a0cae143380e149cb01141d1
7
- data.tar.gz: 947debff1c449e7d9cd1433d9043983f673a3f7d56d59a7b348ccfaefabbf3456764715d5668c8c152ef0eb3f003ff31e6852d17e2b1eb2e7fbbffdfdcaac7d8
6
+ metadata.gz: 6d68d890d9a9b4ffbcb35fe45ab3554e95fc4512b6a5e32dc229a7729db563368102531df3895d0b781c5e8a3717744c03f31e2156f5e2907573c2d08397c4d7
7
+ data.tar.gz: c45bd88b0bdba1933bab2ed46a121e359746e2dc38fedf85148491c3f0a9d13a5150548a1af301b48be996a0af8cfdd83602eba2f0a3c47f7ae9e832bbd1964b
@@ -1,5 +1,5 @@
1
1
  module Megam
2
2
  class API
3
- VERSION = "0.7.7"
3
+ VERSION = "0.7.8"
4
4
  end
5
5
  end
@@ -21,12 +21,12 @@ module Megam
21
21
  end
22
22
 
23
23
 
24
- def self.create(node_name, group, action, tmp_email, tmp_api_key)
24
+ def self.create(data, group, action, tmp_email, tmp_api_key)
25
25
  delete_command = self.new(tmp_email, tmp_api_key)
26
26
  begin
27
- node_collection = delete_command.megam_rest.get_node(node_name)
27
+ node_collection = delete_command.megam_rest.get_node(data[:node_name])
28
28
  ct_collection = delete_command.megam_rest.get_cloudtools
29
-
29
+ cts_collection = delete_command.megam_rest.get_cloudtoolsettings
30
30
  rescue ArgumentError => ae
31
31
  hash = {"msg" => ae.message, "msg_type" => "error"}
32
32
  re = Megam::Error.from_hash(hash)
@@ -40,13 +40,19 @@ module Megam
40
40
  re = Megam::Error.from_hash(hash)
41
41
  return re
42
42
  end
43
-
44
- node = node_collection.data[:body].lookup(node_name)
43
+
44
+ node = node_collection.data[:body].lookup(data[:node_name])
45
45
  tool = ct_collection.data[:body].lookup(node.request[:command]['systemprovider']['provider']['prov'])
46
46
  template = tool.cloudtemplates.lookup(node.request[:command]['compute']['cctype'])
47
- cloud_instruction = template.lookup_by_instruction(group, action)
48
- ci_command = "#{cloud_instruction.command}"
49
- ci_command["<node_name>"] = "#{node_name}"
47
+ cloud_instruction = template.lookup_by_instruction(group, action)
48
+ cts = cts_collection.data[:body].lookup(data[:repo])
49
+ ci_command = "#{cloud_instruction.command}"
50
+ if ci_command["<node_name>"].present?
51
+ ci_command["<node_name>"] = "#{data[:node_name]}"
52
+ end
53
+ if ci_command["-c"].present?
54
+ ci_command["-c"] = "-c #{cts.conf_location}"
55
+ end
50
56
  command_hash = {
51
57
  "systemprovider" => {
52
58
  "provider" => {
@@ -62,8 +68,10 @@ module Megam
62
68
  "tenant_id" => "#{node.request[:command]['compute']['tenant_id']}"
63
69
  },
64
70
  "access" => {
65
- "ssh_key" => "#{node.request[:command]['compute']['access']['ssh_key']}",
66
- "identity_file" => "#{node.request[:command]['compute']['access']['identity_file']}",
71
+ #"ssh_key" => "#{node.request[:command]['compute']['access']['ssh_key']}",
72
+ #"identity_file" => "#{node.request[:command]['compute']['access']['identity_file']}",
73
+ "ssh_key" => "",
74
+ "identity_file" => "",
67
75
  "ssh_user" => "",
68
76
  "vault_location" => "#{node.request[:command]['compute']['access']['vault_location']}",
69
77
  "sshpub_location" => "#{node.request[:command]['compute']['access']['sshpub_location']}",
@@ -73,17 +81,16 @@ module Megam
73
81
  },
74
82
  "cloudtool" => {
75
83
  "chef" => {
76
- "command" => "#{node.request[:command]['cloudtool']['chef']['prov']}",
84
+ "command" => "#{node.request[:command]['cloudtool']['chef']['command']}",
77
85
  "plugin" => "#{node.request[:command]['compute']['cctype']} #{ci_command}", #ec2 server delete or create
78
86
  "run_list" => "",
79
- "name" => "-N #{node_name}"
87
+ "name" => "-N #{data[:node_name]}"
80
88
  }
81
89
  }
82
- }
83
-
90
+ }
84
91
  node_hash = {
85
- "node_name" => "#{node_name}",
86
- "node_type" => "#{node[:node_type]}",
92
+ "node_name" => "#{data[:node_name]}",
93
+ "node_type" => "#{node.node_type}",
87
94
  "req_type" => "#{action}",
88
95
  "noofinstances" => "",
89
96
  "command" => command_hash,
@@ -92,7 +99,7 @@ module Megam
92
99
  "boltdefns" => {},
93
100
  "appreq" => {},
94
101
  "boltreq" => {}
95
- }
102
+ }
96
103
  node_hash
97
104
  end
98
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: megam_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kishorekumar Neelamegam, Thomas Alrin, Subash Sethurajan, Rajthilak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-11 00:00:00.000000000 Z
11
+ date: 2014-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon