enfcli 4.0.0 → 4.1.0.pre.alpha

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.
@@ -15,21 +15,22 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- require 'enfthor'
19
- require 'enfapi'
20
- require 'json'
21
- require 'erb'
18
+ require "enfthor"
19
+ require "enfapi"
20
+ require "json"
21
+ require "erb"
22
22
 
23
23
  module EnfCli
24
24
  module Cmd
25
25
  class Captive < EnfThor
26
- desc 'list-wifi-configurations',
27
- 'List wifi configuration information for all or the matching records.'
28
- method_option :name, default: nil, type: :string, banner: 'NAME',
29
- desc: 'where NAME will match the user-given name.'
30
- method_option :domain, default: nil, type: :string, banner: 'DOMAIN',
31
- aliases: '-d'
32
- method_option :ssid, default: nil, type: :string, banner: 'SSID'
26
+ desc "list-wifi-configurations",
27
+ "List wifi configuration information for all or the matching records."
28
+ method_option :name, default: nil, type: :string, banner: "NAME",
29
+ desc: "where NAME will match the user-given name."
30
+ method_option :domain, default: nil, type: :string, banner: "DOMAIN",
31
+ aliases: "-d"
32
+ method_option :ssid, default: nil, type: :string, banner: "SSID"
33
+
33
34
  def list_wifi_configurations
34
35
  try_with_rescue_in_session do
35
36
  ## TODO: V1 is only listing all of the wifi configurations, it is not
@@ -40,15 +41,16 @@ module EnfCli
40
41
  # display the data
41
42
  display_wifi_configs wifi_configs
42
43
  else
43
- say 'No WiFi configurations found.'
44
+ say "No WiFi configurations found."
44
45
  end
45
46
  end
46
47
  end
47
48
 
48
- desc 'create-wifi-configuration', 'Create a new wifi configuration.'
49
+ desc "create-wifi-configuration", "Create a new wifi configuration."
49
50
  method_option :'wifi-config-file', type: :string, required: true,
50
- banner: '<file>',
51
- desc: '<file> is JSON file with parameters required for configuring the router card.'
51
+ banner: "<file>",
52
+ desc: "<file> is JSON file with parameters required for configuring the router card."
53
+
52
54
  def create_wifi_configuration
53
55
  try_with_rescue_in_session do
54
56
  json_file_name = options[:'wifi-config-file']
@@ -65,20 +67,21 @@ module EnfCli
65
67
  end
66
68
  end
67
69
 
68
- desc 'get-wifi-configuration',
69
- 'Get details of the specified wifi configuration. Exactly one of: ' \
70
- '--wifi-id, --profile-id, --device-id, or --wifi-name must be ' \
71
- 'specified.'
72
- method_option :'wifi-id', defaut: nil, type: :string, banner: 'WIFI-ID',
73
- desc: 'WIFI-ID is the UUID of the wifi record'
74
- method_option :version, defaut: nil, type: :string, banner: 'VERSION',
75
- desc: 'Optionally used with --wifi-id'
76
- method_option :'profile-id', defaut: nil, type: :string, banner: 'PROFILE-ID',
77
- desc: 'PROFILE-ID is the UUID of the profile.'
78
- method_option :'device-id', defaut: nil, type: :string, banner: 'DEVICE-ID',
79
- desc: 'DEVICE-ID is the UUID of the device.'
80
- method_option :'wifi-name', defaut: nil, type: :string, banner: 'WIFI-NAME',
81
- desc: 'Result matches any wifi configuration that contains the substring WIFI-NAME'
70
+ desc "get-wifi-configuration",
71
+ "Get details of the specified wifi configuration. Exactly one of: " \
72
+ "--wifi-id, --profile-id, --device-id, or --wifi-name must be " \
73
+ "specified."
74
+ method_option :'wifi-id', defaut: nil, type: :string, banner: "WIFI-ID",
75
+ desc: "WIFI-ID is the UUID of the wifi record"
76
+ method_option :version, defaut: nil, type: :string, banner: "VERSION",
77
+ desc: "Optionally used with --wifi-id"
78
+ method_option :'profile-id', defaut: nil, type: :string, banner: "PROFILE-ID",
79
+ desc: "PROFILE-ID is the UUID of the profile."
80
+ method_option :'device-id', defaut: nil, type: :string, banner: "DEVICE-ID",
81
+ desc: "DEVICE-ID is the UUID of the device."
82
+ method_option :'wifi-name', defaut: nil, type: :string, banner: "WIFI-NAME",
83
+ desc: "Result matches any wifi configuration that contains the substring WIFI-NAME"
84
+
82
85
  def get_wifi_configuration
83
86
  try_with_rescue_in_session do
84
87
  ## TODO - Currently, this only handles wifi-id, add the others to v2
@@ -95,31 +98,30 @@ module EnfCli
95
98
  num_query_opts += 1 if device_id
96
99
  num_query_opts += 1 if wifi_name
97
100
 
98
-
99
- raise 'ERROR: Exactly one of: --wifi-id, --profile-id, --device-id, or --wifi-name must be specified.' if num_query_opts != 1
101
+ raise "ERROR: Exactly one of: --wifi-id, --profile-id, --device-id, or --wifi-name must be specified." if num_query_opts != 1
100
102
 
101
103
  if wifi_id
102
104
  wifi_config = EnfApi::Captive.instance.get_wifi_configuration wifi_id, version
103
105
 
104
106
  # display the data
105
107
  display_wifi_detail wifi_config
106
-
107
108
  end
108
109
  end
109
110
  end
110
111
 
111
- desc 'update-wifi-configuration',
112
- 'Update an existing wifi configuration.'
112
+ desc "update-wifi-configuration",
113
+ "Update an existing wifi configuration."
113
114
  method_option :'wifi-id', type: :string,
114
115
  required: true,
115
- banner: 'WIFI-ID',
116
- desc: 'WIFI-ID is the UUID of the wifi profile'
116
+ banner: "WIFI-ID",
117
+ desc: "WIFI-ID is the UUID of the wifi profile"
117
118
  method_option :'wifi-config-file', type: :string,
118
119
  required: true,
119
- banner: '<file>',
120
- desc: '<file> is JSON file with ' \
121
- 'parameters required for ' \
122
- 'configuring the router card.'
120
+ banner: "<file>",
121
+ desc: "<file> is JSON file with " \
122
+ "parameters required for " \
123
+ "configuring the router card."
124
+
123
125
  def update_wifi_configuration
124
126
  try_with_rescue_in_session do
125
127
  json_file_name = options[:'wifi-config-file']
@@ -133,29 +135,29 @@ module EnfCli
133
135
  end
134
136
  end
135
137
 
138
+ desc "create-device",
139
+ "Add a new device to the database. This is only available to Xaptum administrators"
140
+ method_option :'device-id', type: :string, required: true, banner: "SERIAL-NUM",
141
+ desc: "SERIAL-NUM is the serial number of the device."
142
+ method_option :'device-name', type: :string, default: nil, banner: "DEVICE-NAME",
143
+ desc: "User-defined name for the device."
144
+ method_option :'mac-addr1', type: :string, default: nil, banner: "MAC-ADDR1",
145
+ desc: "MAC address 1 (wifi address on a wifi-enabled device)"
146
+ method_option :'mac-addr2', type: :string, default: nil, banner: "MAC-ADDR2",
147
+ desc: "MAC address 2"
148
+ method_option :'mac-addr3', type: :string, default: nil, banner: "MAC-ADDR3",
149
+ desc: "MAC address 3"
150
+ method_option :'mac-addr4', type: :string, default: nil, banner: "MAC-ADDR4",
151
+ desc: "MAC address 4"
152
+ method_option :'profile-id', type: :string, default: nil, banner: "PROFILE_ID",
153
+ desc: "UUID of the profile that the device will use. The profile must already exist."
154
+ method_option :model, type: :string, default: nil, banner: "MODEL",
155
+ desc: "Model identifier of the device"
136
156
 
137
- desc 'create-device',
138
- 'Add a new device to the database. This is only available to Xaptum administrators'
139
- method_option :'device-id', type: :string, required: true, banner: 'SERIAL-NUM',
140
- desc: 'SERIAL-NUM is the serial number of the device.'
141
- method_option :'device-name', type: :string, default: nil, banner: 'DEVICE-NAME',
142
- desc: 'User-defined name for the device.'
143
- method_option :'mac-addr1', type: :string, default: nil, banner: 'MAC-ADDR1',
144
- desc: 'MAC address 1 (wifi address on a wifi-enabled device)'
145
- method_option :'mac-addr2', type: :string, default: nil, banner: 'MAC-ADDR2',
146
- desc: 'MAC address 2'
147
- method_option :'mac-addr3', type: :string, default: nil, banner: 'MAC-ADDR3',
148
- desc: 'MAC address 3'
149
- method_option :'mac-addr4', type: :string, default: nil, banner: 'MAC-ADDR4',
150
- desc: 'MAC address 4'
151
- method_option :'profile-id', type: :string, default: nil, banner: 'PROFILE_ID',
152
- desc: 'UUID of the profile that the device will use. The profile must already exist.'
153
- method_option :model, type: :string, default: nil, banner: 'MODEL',
154
- desc: 'Model identifier of the device'
155
157
  def create_device
156
158
  try_with_rescue_in_session do
157
159
  new_device_hash = {
158
- serial_number: options[:'device-id']
160
+ serial_number: options[:'device-id'],
159
161
  }
160
162
 
161
163
  mac1 = options[:'mac-addr1']
@@ -192,10 +194,11 @@ module EnfCli
192
194
  end
193
195
  end
194
196
 
195
- desc 'list-devices',
196
- 'List basic device information for all devices matching the option specified.'
197
- method_option :network, default: nil, type: :string, banner: 'NETWORK',
198
- desc: 'NETWORK is the ipv6 subnet used by the device.'
197
+ desc "list-devices",
198
+ "List basic device information for all devices matching the option specified."
199
+ method_option :network, default: nil, type: :string, banner: "NETWORK",
200
+ desc: "NETWORK is the ipv6 subnet used by the device."
201
+
199
202
  def list_devices
200
203
  try_with_rescue_in_session do
201
204
  network = options[:network]
@@ -205,11 +208,12 @@ module EnfCli
205
208
  end
206
209
  end
207
210
 
208
- desc 'get-device',
209
- 'Get details of the specified device.'
211
+ desc "get-device",
212
+ "Get details of the specified device."
210
213
  method_option :'device-id', required: true, type: :string,
211
- banner: 'DEVICE-ID',
212
- desc: 'DEVICE-ID is either the device serial number or its ipv6 address.'
214
+ banner: "DEVICE-ID",
215
+ desc: "DEVICE-ID is either the device serial number or its ipv6 address."
216
+
213
217
  def get_device
214
218
  try_with_rescue_in_session do
215
219
  device_id = ERB::Util::url_encode(options[:'device-id'])
@@ -220,14 +224,15 @@ module EnfCli
220
224
  end
221
225
  end
222
226
 
223
- desc 'update-device',
224
- 'Update an existing device record with the values specified.'
225
- method_option :'device-id', type: :string, required: true, banner: 'DEVICE-ID',
226
- desc: 'DEVICE-ID is either the device serial number or its ipv6 address.'
227
- method_option :'device-name', type: :string, default: nil, banner: 'DEVICE-NAME',
228
- desc: 'User-defined name for the device.'
229
- method_option :'profile-id', type: :string, default: nil, banner: 'PROFILE_ID',
230
- desc: 'UUID of the profile that the device will use. The profile must already exist.'
227
+ desc "update-device",
228
+ "Update an existing device record with the values specified."
229
+ method_option :'device-id', type: :string, required: true, banner: "DEVICE-ID",
230
+ desc: "DEVICE-ID is either the device serial number or its ipv6 address."
231
+ method_option :'device-name', type: :string, default: nil, banner: "DEVICE-NAME",
232
+ desc: "User-defined name for the device."
233
+ method_option :'profile-id', type: :string, default: nil, banner: "PROFILE_ID",
234
+ desc: "UUID of the profile that the device will use. The profile must already exist."
235
+
231
236
  def update_device
232
237
  try_with_rescue_in_session do
233
238
  id = ERB::Util::url_encode(options[:'device-id'])
@@ -248,11 +253,12 @@ module EnfCli
248
253
  end
249
254
  end
250
255
 
251
- desc 'get-device-status',
252
- 'Get the latest status of the specified device.'
256
+ desc "get-device-status",
257
+ "Get the latest status of the specified device."
253
258
  method_option :'device-id', required: true, type: :string,
254
- banner: 'DEVICE-ID',
255
- desc: 'DEVICE-ID is either the device serial number or its ipv6 address.'
259
+ banner: "DEVICE-ID",
260
+ desc: "DEVICE-ID is either the device serial number or its ipv6 address."
261
+
256
262
  def get_device_status
257
263
  try_with_rescue_in_session do
258
264
  device_id = ERB::Util::url_encode(options[:'device-id'])
@@ -262,22 +268,23 @@ module EnfCli
262
268
  end
263
269
  end
264
270
 
265
- desc 'create-profile',
266
- 'Create a new profile.'
271
+ desc "create-profile",
272
+ "Create a new profile."
267
273
  method_option :'profile-name', type: :string, required: true,
268
- banner: 'PROFILE-NAME',
269
- desc: 'PROFILE-NAME is the user-given name.'
274
+ banner: "PROFILE-NAME",
275
+ desc: "PROFILE-NAME is the user-given name."
270
276
  method_option :'device-mode', type: :string, required: true,
271
- banner: 'DEVICE-MODE',
272
- desc: 'secure-host or passthrough'
273
- method_option :'wifi-id', type: :string, default: nil, banner: 'WIFI-ID',
274
- desc: 'WIFI-ID is the UUID of the wifi record that the profile will use. wifi record must already exist'
277
+ banner: "DEVICE-MODE",
278
+ desc: "secure-host or passthrough"
279
+ method_option :'wifi-id', type: :string, default: nil, banner: "WIFI-ID",
280
+ desc: "WIFI-ID is the UUID of the wifi record that the profile will use. wifi record must already exist"
281
+
275
282
  def create_profile
276
283
  try_with_rescue_in_session do
277
284
  profile_name = options[:'profile-name']
278
285
  new_profile_hash = {
279
286
  name: profile_name,
280
- config: { mode: options[:'device-mode'] }
287
+ config: { mode: options[:'device-mode'] },
281
288
  }
282
289
 
283
290
  wifi = options[:'wifi-id']
@@ -292,10 +299,11 @@ module EnfCli
292
299
  end
293
300
  end
294
301
 
295
- desc 'list-profiles',
296
- 'List the existing profiles.'
297
- method_option :name, default: nil, type: :string, banner: 'NAME',
298
- desc: 'where NAME will match all or part of the user-given profile name.'
302
+ desc "list-profiles",
303
+ "List the existing profiles."
304
+ method_option :name, default: nil, type: :string, banner: "NAME",
305
+ desc: "where NAME will match all or part of the user-given profile name."
306
+
299
307
  def list_profiles
300
308
  try_with_rescue_in_session do
301
309
  query_name = options[:name]
@@ -304,14 +312,14 @@ module EnfCli
304
312
  end
305
313
  end
306
314
 
307
- desc 'get-profile',
308
- 'Get full detail listing of the profile.'
309
- method_option :'profile-id', required: true, type: :string,
310
- banner: 'PROFILE-ID',
311
- desc: 'PROFILE-ID is the UUID of the profile.'
312
- # TODO - server doesn't support version yet.
313
- # method_option :version, default: nil, type: :integer, banner: 'VERSION',
314
- # desc: 'Get a specific version.'
315
+ desc "get-profile",
316
+ "Get full detail listing of the profile."
317
+ method_option :'profile-id', required: true, type: :string,
318
+ banner: "PROFILE-ID",
319
+ desc: "PROFILE-ID is the UUID of the profile."
320
+ # TODO - server doesn't support version yet.
321
+ # method_option :version, default: nil, type: :integer, banner: 'VERSION',
322
+ # desc: 'Get a specific version.'
315
323
  def get_profile
316
324
  try_with_rescue_in_session do
317
325
  profile = EnfApi::Captive.instance.get_profile options[:'profile-id']
@@ -319,20 +327,21 @@ module EnfCli
319
327
  end
320
328
  end
321
329
 
322
- desc 'update-profile',
323
- 'Update a previously-created profile specified by PROFILE-ID. At ' \
324
- 'least one property must be changed.'
325
- method_option :'profile-id', required: true, type: :string,
326
- banner: 'PROFILE-ID',
327
- desc: 'UUID of the device profile.'
330
+ desc "update-profile",
331
+ "Update a previously-created profile specified by PROFILE-ID. At " \
332
+ "least one property must be changed."
333
+ method_option :'profile-id', required: true, type: :string,
334
+ banner: "PROFILE-ID",
335
+ desc: "UUID of the device profile."
328
336
  method_option :'profile-name', type: :string, default: nil,
329
- banner: 'PROFILE-NAME',
330
- desc: 'PROFILE-NAME is the user-given name.'
337
+ banner: "PROFILE-NAME",
338
+ desc: "PROFILE-NAME is the user-given name."
331
339
  method_option :'device-mode', type: :string, default: nil,
332
- banner: 'DEVICE-MODE',
333
- desc: 'secure-host or passthrough'
334
- method_option :'wifi-id', type: :string, default: nil, banner: 'WIFI-ID',
335
- desc: 'WIFI-ID is the UUID of the wifi record that the profile will use. wifi record must already exist'
340
+ banner: "DEVICE-MODE",
341
+ desc: "secure-host or passthrough"
342
+ method_option :'wifi-id', type: :string, default: nil, banner: "WIFI-ID",
343
+ desc: "WIFI-ID is the UUID of the wifi record that the profile will use. wifi record must already exist"
344
+
336
345
  def update_profile
337
346
  try_with_rescue_in_session do
338
347
  id = options[:'profile-id']
@@ -353,11 +362,9 @@ module EnfCli
353
362
 
354
363
  profile = EnfApi::Captive.instance.update_profile id, update_hash
355
364
  display_profile profile
356
-
357
365
  end
358
366
  end
359
367
 
360
-
361
368
  #########################################################################
362
369
  #
363
370
  # Helper functions
@@ -367,7 +374,7 @@ module EnfCli
367
374
  # Displays the wifi configuration summary list.
368
375
  # TODO - Does non-Xaptum-admin columns only - add option to do admin list
369
376
  def display_wifi_configs(configs)
370
- headings = ['ID', 'Wifi Name', 'Config Vers.']
377
+ headings = ["ID", "Wifi Name", "Config Vers."]
371
378
  rows = configs.map do |hash|
372
379
  [hash[:id], hash[:name], hash[:version]]
373
380
  end
@@ -376,7 +383,7 @@ module EnfCli
376
383
  end
377
384
 
378
385
  # Display a single wifi configuration in detail
379
- def display_wifi_detail(wifi_data, full_listing=true)
386
+ def display_wifi_detail(wifi_data, full_listing = true)
380
387
  name = wifi_data[:name]
381
388
  wifi_id = wifi_data[:id]
382
389
  desc = wifi_data[:description]
@@ -392,9 +399,7 @@ module EnfCli
392
399
  display_wifi_net(wifi_net, 1)
393
400
  end
394
401
  end
395
-
396
402
  end
397
-
398
403
  end
399
404
 
400
405
  def display_wifi_net(wifi_net, tabs)
@@ -412,7 +417,7 @@ module EnfCli
412
417
  display_ipv6_addr(wifi_net[:IPv6], tabs + 1)
413
418
  end
414
419
 
415
- def display_ipv4_addr (ipv4, tabs)
420
+ def display_ipv4_addr(ipv4, tabs)
416
421
  indent = " " * tabs
417
422
  if ipv4.instance_of? String
418
423
  say indent + "IPv4 : #{ipv4}", nil, true
@@ -435,7 +440,7 @@ module EnfCli
435
440
  end
436
441
  end
437
442
 
438
- def display_ipv6_addr (ipv6, tabs)
443
+ def display_ipv6_addr(ipv6, tabs)
439
444
  indent = " " * tabs
440
445
  if ipv6.instance_of? String
441
446
  say indent + "IPv6 : #{ipv6}", nil, true
@@ -458,8 +463,6 @@ module EnfCli
458
463
  end
459
464
  end
460
465
 
461
-
462
-
463
466
  #
464
467
  # display the device info.
465
468
  # device_data is a hash matching the json structure
@@ -469,8 +472,8 @@ module EnfCli
469
472
  ctl_addr = device_data[:control_address]
470
473
  dev_addr = device_data[:device_address] || "\n"
471
474
  mac_addrs = device_data[:mac_address]
472
- firmware = device_data[:firmware_version] || '< not available >'
473
- model = device_data[:model] || '< not available >'
475
+ firmware = device_data[:firmware_version] || "< not available >"
476
+ model = device_data[:model] || "< not available >"
474
477
  profile = device_data[:profile]
475
478
  status = device_data[:status]
476
479
 
@@ -485,18 +488,18 @@ module EnfCli
485
488
  mac4 = mac_addrs[:'4']
486
489
 
487
490
  if !mac1
488
- say 'Mac Address : < not available >'
491
+ say "Mac Address : < not available >"
489
492
  elsif !mac2 && !mac3 && !mac4
490
493
  say "Mac Address : #{mac1}", nil, true
491
494
  else
492
- say 'Mac Address :'
495
+ say "Mac Address :"
493
496
  say " 1 : #{mac1}", nil, true
494
497
  say " 2 : #{mac2}", nil, true if mac2
495
498
  say " 3 : #{mac3}", nil, true if mac3
496
499
  say " 4 : #{mac4}", nil, true if mac4
497
500
  end
498
501
  else
499
- say 'Mac Address : < not available >'
502
+ say "Mac Address : < not available >"
500
503
  end
501
504
 
502
505
  say "Firmware Version : #{firmware}", nil, true
@@ -508,19 +511,19 @@ module EnfCli
508
511
  say "Profile : < not available >"
509
512
  end
510
513
  display_device_status_summary status
511
- say ' ', nil, true
514
+ say " ", nil, true
512
515
  end
513
516
 
514
- #
517
+ #
515
518
  # display the status summary
516
519
  #
517
- def display_device_status_summary (device_status)
520
+ def display_device_status_summary(device_status)
518
521
  if device_status
519
- mode = device_status[:router_mode] || device_status[:mode] || '< not available >'
522
+ mode = device_status[:router_mode] || device_status[:mode] || "< not available >"
520
523
 
521
524
  wifi = device_status[:wifi]
522
525
 
523
- say 'Status :'
526
+ say "Status :"
524
527
  say " Router Mode : #{mode}", nil, true
525
528
 
526
529
  if wifi
@@ -539,21 +542,21 @@ module EnfCli
539
542
  # status is a hash matching the json structure
540
543
  #
541
544
  def display_device_status(device_status)
542
- sn = device_status[:serial_number] || '< not available >'
543
- mode = device_status[:router_mode] || device_status[:mode] || '< not available >'
545
+ sn = device_status[:serial_number] || "< not available >"
546
+ mode = device_status[:router_mode] || device_status[:mode] || "< not available >"
544
547
 
545
- uptime = device_status[:uptime] || '< not available >'
546
- refresh = device_status[:refresh_time] || '< not available >'
548
+ uptime = device_status[:uptime] || "< not available >"
549
+ refresh = device_status[:refresh_time] || "< not available >"
547
550
 
548
551
  wifi = device_status[:wifi]
549
552
  if wifi
550
- connected = wifi[:connected] || '< not available >'
553
+ connected = wifi[:connected] || "< not available >"
551
554
  ssid = wifi[:SSID]
552
555
  ipv4 = wifi[:IPv4_addresses]
553
556
  ipv6 = wifi[:IPv6_addresses]
554
557
  wifi_config = wifi[:config]
555
558
  else
556
- connected = '< not available >'
559
+ connected = "< not available >"
557
560
  ssid = nil
558
561
  ipv4 = nil
559
562
  ipv6 = nil
@@ -583,15 +586,15 @@ module EnfCli
583
586
 
584
587
  display_wifi_detail(wifi_config, false) if wifi_config
585
588
 
586
- say ' ', nil, true
589
+ say " ", nil, true
587
590
  end
588
591
 
589
592
  #
590
593
  # display the devices summary list
591
594
  #
592
595
  def display_device_list(devices)
593
- headings = ['Serial No', 'Dev Name', 'Dev Addr', 'Router Mode',
594
- 'Connected', 'SSID']
596
+ headings = ["Serial No", "Dev Name", "Dev Addr", "Router Mode",
597
+ "Connected", "SSID"]
595
598
  rows = devices.map do |hash|
596
599
  status = hash[:status]
597
600
  if status
@@ -601,10 +604,10 @@ module EnfCli
601
604
  mode = status[:router_mode] || status[:mode]
602
605
 
603
606
  [hash[:serial_number], hash[:device_name], hash[:device_address],
604
- mode, connected, ssid]
607
+ mode, connected, ssid]
605
608
  else
606
609
  [hash[:serial_number], hash[:device_name], hash[:device_address],
607
- nil, nil, nil]
610
+ nil, nil, nil]
608
611
  end
609
612
  end
610
613
  # [hash[:serial_number], hash[:device_name], hash[:device_address],
@@ -618,7 +621,7 @@ module EnfCli
618
621
  # Display profile detail
619
622
  #
620
623
  def display_profile(profile, summary = false)
621
- indent = summary ? ' ' : ''
624
+ indent = summary ? " " : ""
622
625
 
623
626
  say indent + "Name : #{profile[:name]}", nil, true
624
627
  say indent + "Profile ID : #{profile[:id]}", nil, true
@@ -632,7 +635,7 @@ module EnfCli
632
635
  #
633
636
  # Display summary of the WIFI configuration info
634
637
  #
635
- def display_wifi_summary (wifi)
638
+ def display_wifi_summary(wifi)
636
639
  if wifi
637
640
  say "Wifi config :"
638
641
  say " id : #{wifi[:id]}", nil, true
@@ -645,22 +648,19 @@ module EnfCli
645
648
  else
646
649
  say "Wifi config : < not configured >"
647
650
  end
648
-
649
651
  end
650
652
 
651
653
  #
652
654
  # display the profile summary list
653
655
  #
654
656
  def display_profile_list(profiles)
655
- headings = ['Profile Name', 'Profile ID', 'Version']
657
+ headings = ["Profile Name", "Profile ID", "Version"]
656
658
  rows = profiles.map do |hash|
657
659
  [hash[:name], hash[:id], hash[:config][:version]]
658
660
  end
659
661
 
660
662
  render_table(headings, rows)
661
663
  end
662
-
663
-
664
664
  end
665
665
  end
666
666
  end