MuranoCLI 3.2.2.beta.1 → 3.2.2.beta.2

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
  SHA256:
3
- metadata.gz: f04979f9c6537564334a7b27e3bcbcb8170f2d03bbd8671ff2a4cd1ded574e2b
4
- data.tar.gz: 1f64fcef2dc2f78af895963e13fd6aa33ddd142ec7f582625325985ad26fc3e7
3
+ metadata.gz: 12d344b05fe0a8a403f5d166b1ac75b5b111a476111612b4ba45134e307d5df3
4
+ data.tar.gz: d53c7a3d60aac2088cf707616e0bcfdcef62d96a722bd1f438221b962866f5b8
5
5
  SHA512:
6
- metadata.gz: 9d0cf2a926767fcba117514e27845ec796be9bae47cd1472d1a9e3774b6664f1121e1415f719de97947d7e5885270c6fd57e53d0667005bed4d7360e723b670a
7
- data.tar.gz: 875ef855f9f777409d055518eadae32d25fd1442cd47fe9fd3679e2e3f65d0a095a6047a8d0869f74bf2d91df3b40f0a1b48fc58dd111383b568cefe2a05bc8c
6
+ metadata.gz: 7e79ea5d8fd3e7cdb3f947f801523d6c8c663ea2d2cd59ac97ef2c328052215660986f0698ba7f1351f039c9af9106a0cf54fa144ad930b8e6da6eb469870e88
7
+ data.tar.gz: 58c1a02f8df8d9f4d9cf868d70e8280b7f2b763a3627471dcf8d91b6fc28dab7ed7be2f1ed1b190aed20a7a4b0b54a7bacb9f2756988a7b3e27529b23e31b72f
data/HISTORY.md CHANGED
@@ -2,6 +2,52 @@
2
2
 
3
3
  ---------------------------------------------------------------------------
4
4
 
5
+ ## Murano CLI v3.2.2.beta.2 (2018-08-30)
6
+
7
+ ### Improved
8
+
9
+ - Allow `murano logs` to be run from anywhere (no longer require being run from within a project directory). (Issue: [MUR-6519](https://i.exosite.com/jira/browse/MUR-6519))
10
+
11
+ - Generally, when no solutions found, exit immediately with nonzero error code. (Issue: [MUR-7081](https://i.exosite.com/jira/browse/MUR-7081))
12
+
13
+ - For any command, check if optional arguments are specified before the complete command name, and show usage help if so. (Issue: [MUR-7171](https://i.exosite.com/jira/browse/MUR-7171))
14
+
15
+ ### Fixed
16
+
17
+ - Relax Solution name validation to only worry about length (e.g., allow special characters, such as “™”). (Issue: [MUR-7736](https://i.exosite.com/jira/browse/MUR-7736))
18
+
19
+ - Fix specifying value to `keystore set` using `STDIN` (e.g., `echo "my value" | murano keystore set my_key`). (Issue: [MUR-4410](https://i.exosite.com/jira/browse/MUR-4410))
20
+
21
+ - Do not support `hash` or `signature` as valid `device enable` `--auth` types. (Issue: [MUR-7350](https://i.exosite.com/jira/browse/MUR-7350))
22
+
23
+ - Prefer BizAPI's `sid` over deprecated `api_id` (and do not throw error if ID is missing but warn user instead). (Issue: [MUR-6646](https://i.exosite.com/jira/browse/MUR-6646))
24
+
25
+ - Print nothing on `progresql "UPDATE..."` rather than crashing (and do same for any PostgreSQL command that generates an empty response). (Issue: [MUR-5133](https://i.exosite.com/jira/browse/MUR-5133))
26
+
27
+ (Thank you, CLI Hackday Participants!)
28
+
29
+ ---------------------------------------------------------------------------
30
+
31
+ ## Murano CLI v3.2.2.beta.1 (2018-08-24)
32
+
33
+ ### Fixed
34
+
35
+ - On `murano init`, display Product names in Solution picker rather than Product IDs. (Issue: [MUR-5026](https://i.exosite.com/jira/browse/MUR-5026))
36
+
37
+ ### Developer improvements
38
+
39
+ - New `rake version` command.
40
+
41
+ ---------------------------------------------------------------------------
42
+
43
+ ## Murano CLI v3.2.1 (2018-08-17)
44
+
45
+ ### New, Improved, Fixed
46
+
47
+ - See notes below for the intermediate `3.2.1.pre.beta.*` builds.
48
+
49
+ ---------------------------------------------------------------------------
50
+
5
51
  ## Murano CLI v3.2.1.pre.beta.7 (2018-08-09)
6
52
 
7
53
  ### Improved
@@ -424,9 +424,7 @@ module MrMurano
424
424
 
425
425
  DEVICE_AUTH_TYPES = %i[
426
426
  certificate
427
- hash
428
427
  password
429
- signature
430
428
  token
431
429
  csr
432
430
  ].freeze
@@ -154,6 +154,8 @@ module Commander
154
154
  defopts = ($cfg["#{active_command.name}.options"] || '').split
155
155
  @args.push(*defopts)
156
156
  end_of_options_hack
157
+ # Check if they are passing an option first
158
+ must_not_option_passed_first!
157
159
  do_help = help_hack
158
160
  $cfg.validate_cmd_business_and_project(active_command) unless do_help
159
161
  parse_global_options_real
@@ -198,6 +200,13 @@ module Commander
198
200
  %w[-v --version].freeze
199
201
  end
200
202
 
203
+ def must_not_option_passed_first!
204
+ return unless @args[0].to_s.start_with? '-'
205
+ return if %w[-h --help -v --version].include? @args[0]
206
+ MrMurano::Verbose.warning('Usage: murano <sub-cmd> [<options>]')
207
+ exit 1
208
+ end
209
+
201
210
  def fix_args_for_help
202
211
  # If `murano --help` is specified, let rb-commander handle it.
203
212
  # But if `murano command --help` is specified, don't let cmdr
@@ -86,7 +86,9 @@ module MrMurano
86
86
  class Solution < SolutionBase
87
87
  def initialize(api_id=nil)
88
88
  meta = api_id if api_id.is_a?(Hash)
89
- api_id = api_id[:api_id] || api_id[:apiId] if api_id.is_a?(Hash)
89
+ # TODO: Deprecate usage of solution.apiId from BizAPI; migrate to solution.sid.
90
+ # Bizapi is currently returning both values set to the same thing.
91
+ api_id = api_id[:sid] || api_id[:api_id] || api_id[:apiId] if api_id.is_a?(Hash)
90
92
  super(api_id)
91
93
  set_name
92
94
  @meta = {}
@@ -329,9 +331,9 @@ module MrMurano
329
331
 
330
332
  # FIXME/2017-06-28: Test uppercase characters again.
331
333
 
332
- # SYNC_ME: See regex in bizapi: lib/api/route/business/solution.js
334
+ # Validate the solution name field, not the label. This can be anything and is not unique.
333
335
  def name_validate_regex
334
- /^[a-zA-Z0-9\-\s]{1,63}$/
336
+ /^.{1,63}$/
335
337
  end
336
338
 
337
339
  def name_validate_help
@@ -349,9 +351,9 @@ The name must contain at least 1 character and no more than 63.
349
351
  super
350
352
  end
351
353
 
352
- # SYNC_ME: See regex in bizapi: lib/api/route/business/solution.js
354
+ # Validate the solution name field, not the label. This can be anything and is not unique.
353
355
  def name_validate_regex
354
- /^(?![0-9])[a-zA-Z0-9]{2,63}$/
356
+ /^.{2,63}$/
355
357
  end
356
358
 
357
359
  def name_validate_help
@@ -25,7 +25,7 @@ module MrMurano
25
25
  # see instead 'application.id' and 'product.id'. We just
26
26
  # use 'solution.id' to indicate that the caller specified
27
27
  # a solution ID explicitly (i.e., it's not from the $cfg).
28
- raise 'Missing api_id or class @solntype!?' if api_id.to_s.empty?
28
+ warn 'Missing api_id or class @solntype!?' if api_id.to_s.empty?
29
29
  @solntype = 'solution.id'
30
30
  end
31
31
  if api_id
@@ -98,12 +98,28 @@ Set the value of a key in the Keystore.
98
98
  c.must_not_be_managed = true
99
99
 
100
100
  c.action do |args, _options|
101
- c.verify_arg_count!(args, nil, ['Missing key', 'Missing value(s)'])
101
+ c.verify_arg_count!(args, nil, ['Missing key'])
102
+ value = args[1..-1]
103
+
104
+ if !value.nil?
105
+ value = value.join(' ')
106
+ else
107
+ resp = IO.select([$stdin], nil, nil, 0)
108
+ value = $stdin.read unless resp.nil?
109
+ end
110
+ must_have_value!(value)
111
+
102
112
  sol = MrMurano::Keystore.new
103
- sol.setkey(args[0], args[1..-1].join(' '))
113
+ sol.setkey(args[0], value)
104
114
  end
105
115
  end
106
116
 
117
+ def must_have_value!(value)
118
+ return unless value.nil?
119
+ MrMurano::Verbose.warning('Missing value')
120
+ exit 1
121
+ end
122
+
107
123
  command 'keystore delete' do |c|
108
124
  c.syntax = %(murano keystore delete <key>)
109
125
  c.summary = %(Delete a key from the Keystore)
@@ -66,6 +66,7 @@ class LogsCmd
66
66
  cmd_add_logs_options(cmd)
67
67
  cmd_add_format_options(cmd)
68
68
  cmd_add_filter_options(cmd)
69
+ cmd.project_not_required = true
69
70
  cmd.action do |args, options|
70
71
  @options = options
71
72
  cmd.verify_arg_count!(args)
@@ -77,6 +77,7 @@ Queries can include $# escapes that are filled from the --param option.
77
77
  io = File.open(options.output, 'w') if options.output
78
78
 
79
79
  def pretty_res(pg, res, ios)
80
+ return if (res[:rows] || []).empty?
80
81
  rows = res[:rows].map do |row|
81
82
  row.map do |cell|
82
83
  if cell.is_a?(Hash) && cell.keys.sort == %i[day hour min month sec usec year]
@@ -386,7 +386,7 @@ def cmd_solution_find_and_output(args, options)
386
386
  end
387
387
 
388
388
  def cmd_solution_find_solutions(biz, args, options)
389
- must_fetch_solutions!(options, args, biz)
389
+ must_fetch_solutions!(options, args, biz, exitnonzero: true)
390
390
  end
391
391
 
392
392
  def cmd_solution_output_solutions(biz, solz, options)
@@ -91,7 +91,7 @@ end
91
91
  # cmd_add_solntype_pickers, and then in the action block, call
92
92
  # cmd_defaults_solntype_pickers, and then call this method.
93
93
  # - Optional restrict to just solutions in the current project.
94
- def must_fetch_solutions!(options, args=[], biz=nil)
94
+ def must_fetch_solutions!(options, args=[], biz=nil, exitnonzero: false)
95
95
  solz = []
96
96
 
97
97
  if biz.nil?
@@ -185,7 +185,7 @@ def must_fetch_solutions!(options, args=[], biz=nil)
185
185
 
186
186
  if solz.empty?
187
187
  MrMurano::Verbose.error(MSG_SOLUTIONS_NONE_FOUND)
188
- exit 0
188
+ exit exitnonzero && 1 || 0
189
189
  end
190
190
 
191
191
  biz.sort_solutions!(solz)
@@ -26,7 +26,7 @@ module MrMurano
26
26
  # '3.0.0-beta.2' is changed to '3.0.0.pre.beta.2'
27
27
  # which breaks our build (which expects the version to match herein).
28
28
  # So stick to using the '.pre.X' syntax, which ruby/gems knows.
29
- VERSION = '3.2.2.beta.1'
29
+ VERSION = '3.2.2.beta.2'
30
30
  EXE_NAME = File.basename($PROGRAM_NAME)
31
31
  SIGN_UP_URL = 'https://exosite.com/signup/'
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MuranoCLI
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2.beta.1
4
+ version: 3.2.2.beta.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Conrad Tadpol Tilstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-24 00:00:00.000000000 Z
11
+ date: 2018-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: certified