forj 0.0.41 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/boot.rb +1 -1
  3. data/lib/forj-account.rb +12 -10
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01a8a3f3825a0b5242367c3ff69a83675588800e
4
- data.tar.gz: 2f78609c995ebf36be3f4becfc6b7bccbd3d42c4
3
+ metadata.gz: 86bafd8e907ea87422d3ffe34ee5d64030530de9
4
+ data.tar.gz: d129b3a2b79f4c4217730078c135c32ca25e6c96
5
5
  SHA512:
6
- metadata.gz: f8bcda70764cf154d9762ac21f560965317d526c49e120f0469567ef8bd7238abc88638fd786bd5cb1e2bc539a3b4643f40f186c4e01de2bf1912cafc20f5f1d
7
- data.tar.gz: cb6e149758f4111c93012df9f3fa6b4cecd865f408cf23ccca71d516685d630fdee6f57df4cf6a4d0f7169aeb73b6df2c8c4d58f9ce584432c8ec34737a8c435
6
+ metadata.gz: 82ededa706f07e22540a5563e567ff78f0631cb3c5b5779113382d93c755880080cece6f8e2ffc367aea45b8f91147a1daf273b1dde7fa10036bffbb72b980df
7
+ data.tar.gz: 48abdf7a3e8b2efdecccd488fb2a67eba44d607709d5d29899ef75f0628d28e7757178e3490b977a740f5d502f753f48eef60cb4c07d9ab8c7776cacc89fe1d7
data/lib/boot.rb CHANGED
@@ -91,7 +91,7 @@ module Boot
91
91
  Repositories.clone_repo(maestro_url)
92
92
  maestro_repo=File.expand_path('~/.forj/maestro')
93
93
  else
94
- maestro_repo=File.expand_path(oConfig.get(:maestro_repo))
94
+ maestro_repo=File.expand_path(oForjAccount.get(:maestro_repo))
95
95
  if not File.exists?('%s/templates/infra/maestro.box.%s.env' % [maestro_repo, branch])
96
96
  Logging.fatal(1, "'%s' is not a recognized Maestro repository. forj cli searched for templates/infra/%s-maestro.box.GITBRANCH.env.tmpl" % [maestro_repo, cloud_provider])
97
97
  end
data/lib/forj-account.rb CHANGED
@@ -316,6 +316,13 @@ class ForjAccount
316
316
  orig_key_path = File.expand_path(@oConfig.get(:keypair_path, yCreds))
317
317
 
318
318
  Logging.warning("'keypair_path' is missing at least from defaults.yaml. To fix it, set it in your configuration file ~/.forj/config.yaml under default section") if not orig_key_path
319
+
320
+ key_name = ask ("Please provide the keypair name used by default on this account:") do | q |
321
+ q.default = key_name
322
+ q.validate = /.*+/
323
+ end
324
+ key_name = key_name.to_s
325
+
319
326
  key_path = nil
320
327
  while not key_path
321
328
  key_path = ask ("Please provide the SSH private key path used by default on this account:") do | q |
@@ -325,10 +332,10 @@ class ForjAccount
325
332
  keys_entered = keypair_detect(key_name, key_path)
326
333
  if not keys_entered[:private_key_exist?] and not keys_entered[:public_key_exist?]
327
334
  if agree("The key you entered was not found. Do you want to create this one?")
328
- base_dir = File.dirname(keys_entered[:keypair_path])
329
- if File.directory?(base_dir)
330
- if agree("'%s' doesn't exist. Do you want to create it?")
331
- ensure_forj_dirs_exists(base_dir)
335
+ base_dir = keys_entered[:keypair_path]
336
+ if not File.directory?(base_dir)
337
+ if agree("'%s' doesn't exist. Do you want to create it?" % base_dir)
338
+ Helpers.ensure_dir_exists(base_dir)
332
339
  end
333
340
  end
334
341
  else
@@ -344,11 +351,6 @@ class ForjAccount
344
351
  key_name = nil
345
352
  end
346
353
 
347
- key_name = ask ("Please provide the keypair name used by default on this account:") do | q |
348
- q.default = key_name
349
- q.validate = /.*+/
350
- end
351
- key_name = key_name.to_s
352
354
 
353
355
  keys = keypair_detect(key_name, key_path)
354
356
 
@@ -362,7 +364,7 @@ class ForjAccount
362
364
  # Creation sequences
363
365
  if not keys[:private_key_exist?]
364
366
  # Need to create a key. ask if we need so.
365
- Logging.message("Private key file '%s' was not found. forj will propose to create one for you. Please review the proposed private key file name and path.\nYou can press Enter to accept the default value." % keys[:private_key_path])
367
+ Logging.message("The private key file attached to keypair named '%s' is not found. forj will propose to create one for you. Please review the proposed private key file name and path.\nYou can press Enter to accept the default value." % keys[:keypair_name])
366
368
  real_key_path = File.expand_path(ask("Private key file path:") do |q|
367
369
  q.validate = /\w+/
368
370
  q.default = private_key_file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forj
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.41
4
+ version: 0.0.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - forj team