tdl 0.0.4 → 0.0.5

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.
Files changed (3) hide show
  1. data/bin/tdl-config.rb +18 -2
  2. data/tdl-config.yml +28 -28
  3. metadata +2 -2
@@ -21,7 +21,7 @@ class TDLConfig < Thor
21
21
  method_options :interactive => :boolean
22
22
  def create
23
23
  config = get_config
24
- config.merge!(run_interactive) if options[:interactive]
24
+ config.merge!(run_interactive(config)) if options[:interactive]
25
25
  File.open(File.expand_path('~/.tdl-config.yml'), 'w') { |f| f.write config.to_yaml }
26
26
  FileUtils.chmod(0600, File.expand_path('~/.tdl-config.yml'))
27
27
  puts '~/.tdl-config.yml created'.green
@@ -53,7 +53,23 @@ class TDLConfig < Thor
53
53
  config
54
54
  end
55
55
 
56
- def run_interactive(output, options = {})
56
+ def run_interactive(config)
57
+ say 'tdl-config interactive mode, fill in cloud credentials'
58
+ say 'CTRL-D at any point to terminate'
59
+ say 'Leave any field blank to skip'
60
+ nconfig = {}
61
+
62
+ begin
63
+ config.each { |k,v|
64
+ val = ask("#{k}:")
65
+ raise :finished if val.nil?
66
+ nconfig[k] = val
67
+ }
68
+ rescue :finished, Exception => e
69
+ say "\n"
70
+ end
71
+
72
+ nconfig
57
73
  end
58
74
  end
59
75
 
@@ -11,37 +11,37 @@ ssh_cmd:
11
11
  scp_cmd:
12
12
 
13
13
  # for imagefactory ec2
14
- #account:
15
- #access_key:
16
- #secret_access_key:
17
- #certificate:
18
- #key:
14
+ account:
15
+ access_key:
16
+ secret_access_key:
17
+ certificate:
18
+ key:
19
19
 
20
20
  # for imagefactory openstack
21
- #username:
22
- #tenant:
23
- #password:
24
- #strategy:
25
- #auth_url:
26
- #glance_host:
27
- #glance_port:
21
+ username:
22
+ tenant:
23
+ password:
24
+ strategy:
25
+ auth_url:
26
+ glance_host:
27
+ glance_port:
28
28
 
29
29
  # for imagefactory rhevm
30
- #username:
31
- #password:
32
- #api_url:
33
- #nfs_path:
34
- #nfs_dir:
35
- #nfs_host:
36
- #cluster:
37
- #timeout:
30
+ username:
31
+ password:
32
+ api_url:
33
+ nfs_path:
34
+ nfs_dir:
35
+ nfs_host:
36
+ cluster:
37
+ timeout:
38
38
 
39
39
  # for imagefactory vsphere
40
- #username:
41
- #password:
42
- #api_url:
43
- #username:
44
- #password:
45
- #datastore:
46
- #compute_resource:
47
- #network_name:
40
+ username:
41
+ password:
42
+ api_url:
43
+ username:
44
+ password:
45
+ datastore:
46
+ compute_resource:
47
+ network_name:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec