imperituroard 0.2.3 → 0.2.4
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 +4 -4
- data/lib/imperituroard/version.rb +1 -1
- data/lib/imperituroard.rb +16 -16
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c0fda89d8d4dce075e1e6c585c059da9afe3782
|
4
|
+
data.tar.gz: 64255d9787029c2dda3740d9d8ad981128827ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a837fc1af4aded8b465c40178af7ec517c391bbbd4d4b33a133307fdf232c35b24787769d601651f718bf7f67630538279a3a4fc85d5e60b7fb5973e9c655a8b
|
7
|
+
data.tar.gz: 7d8a3702b72ca270dc791b4d4c1c176a1dd950e705bf06aca1c5fe0f2c11e20eda63fbaa3cdfc7e9f93608d8d308c3c8a1a8bc2a498a3a74da99a484598db241
|
data/lib/imperituroard.rb
CHANGED
@@ -461,7 +461,7 @@ class Iot
|
|
461
461
|
for g in device_list
|
462
462
|
p g
|
463
463
|
|
464
|
-
prof_name1 = mongo_client.get_profile_name_from_imei(g[
|
464
|
+
prof_name1 = mongo_client.get_profile_name_from_imei(g["imei"])
|
465
465
|
p prof_name1
|
466
466
|
|
467
467
|
if prof_name1[:code]==200
|
@@ -471,47 +471,47 @@ class Iot
|
|
471
471
|
p permiss1
|
472
472
|
if permiss1[:code]==200
|
473
473
|
|
474
|
-
if g[
|
475
|
-
permiss2 = mongo_client.check_login_profile_permiss(login, g[
|
474
|
+
if g["attributes"].key?("profile")
|
475
|
+
permiss2 = mongo_client.check_login_profile_permiss(login, g["attributes"]["profile"])[:code]
|
476
476
|
|
477
477
|
if permiss2==200
|
478
478
|
|
479
|
-
attr = g[
|
479
|
+
attr = g["attributes"]
|
480
480
|
#mod_attr = {}
|
481
481
|
|
482
|
-
if attr.key?(
|
483
|
-
if attr[
|
482
|
+
if attr.key?("profile")
|
483
|
+
if attr["profile"].is_a? Integer
|
484
484
|
p "Ok"
|
485
485
|
else
|
486
|
-
p new = mongo_client.get_profile_id_by_name(attr[
|
487
|
-
attr[
|
486
|
+
p new = mongo_client.get_profile_id_by_name(attr["profile"])
|
487
|
+
attr["profile"] = new["profile_id"]
|
488
488
|
end
|
489
489
|
end
|
490
490
|
p attr
|
491
491
|
|
492
|
-
mongo_client.device_modify_any_attr_mongo(g[
|
492
|
+
mongo_client.device_modify_any_attr_mongo(g["imei"], attr)
|
493
493
|
|
494
|
-
processed.append(g[
|
494
|
+
processed.append(g["imei"])
|
495
495
|
|
496
496
|
else
|
497
|
-
not_processed.append({:imei=>g[
|
497
|
+
not_processed.append({:imei=>g["imei"], :description=> "New profile permission error", :error=>permiss2 })
|
498
498
|
end
|
499
499
|
|
500
500
|
else
|
501
|
-
attr = g[
|
502
|
-
mongo_client.device_modify_any_attr_mongo(g[
|
501
|
+
attr = g["attributes"]
|
502
|
+
mongo_client.device_modify_any_attr_mongo(g["imei"], attr)
|
503
503
|
|
504
|
-
processed.append(g[
|
504
|
+
processed.append(g["imei"])
|
505
505
|
|
506
506
|
end
|
507
507
|
|
508
508
|
|
509
509
|
else
|
510
|
-
not_processed.append({:imei=>g[
|
510
|
+
not_processed.append({:imei=>g["imei"], :description=> "Old profile permission error", :error=>permiss1 })
|
511
511
|
end
|
512
512
|
|
513
513
|
else
|
514
|
-
not_processed.append({:imei=>g[
|
514
|
+
not_processed.append({:imei=>g["imei"],:error=>prof_name1})
|
515
515
|
end
|
516
516
|
|
517
517
|
end
|