imperituroard 1.1.5 → 1.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/runConfigurations/autovpn.xml +21 -0
  3. data/.idea/runConfigurations/dabrab_proced.xml +21 -0
  4. data/.idea/runConfigurations/test9_dab.xml +21 -0
  5. data/imperituroard.gemspec +1 -1
  6. data/lib/.DS_Store +0 -0
  7. data/lib/imperituroard.rb +57 -5
  8. data/lib/imperituroard/.DS_Store +0 -0
  9. data/lib/imperituroard/add_functions/logger/any_functions.rb +4 -2
  10. data/lib/imperituroard/platforms/iwag/get_iwag_data.rb +90 -0
  11. data/lib/imperituroard/platforms/iwag/iwag_database_worker.rb +24 -0
  12. data/lib/imperituroard/platforms/iwag/iwag_telnet_connector.rb +112 -0
  13. data/lib/imperituroard/platforms/staros/staros_automation.rb +1 -1
  14. data/lib/imperituroard/projects/autovpn.rb +27 -0
  15. data/lib/imperituroard/projects/{vpn/ezuev_fun → autovpn}/functions_ezuev.rb +0 -0
  16. data/lib/imperituroard/projects/autovpn/mongo_vpn.rb +56 -0
  17. data/lib/imperituroard/projects/iot.rb +1 -1
  18. data/lib/imperituroard/projects/iot/add_functions.rb +2 -2
  19. data/lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb +25 -21
  20. data/lib/imperituroard/projects/iot/internal_functions.rb +5 -4
  21. data/lib/imperituroard/projects/mhub.rb +68 -14
  22. data/lib/imperituroard/projects/mhub/gms.rb +96 -0
  23. data/lib/imperituroard/projects/mhub/sk.rb +26 -18
  24. data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb +5 -4
  25. data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +165 -100
  26. data/lib/imperituroard/projects/mhub/subs/evrotorg/gms_connector.rb +69 -0
  27. data/lib/imperituroard/projects/ukaz60.rb +4 -2
  28. data/lib/imperituroard/projects/ukaz60/belgim.rb +1 -1
  29. data/lib/imperituroard/projects/ukaz60/fortigate.rb +1 -1
  30. data/lib/imperituroard/projects/ukaz60/staros.rb +5 -5
  31. data/lib/imperituroard/projects/ukaz60/ukaz60_add_func.rb +50 -4
  32. data/lib/imperituroard/projects/wttx/updatepostcps.rb +7 -7
  33. data/lib/imperituroard/version.rb +1 -1
  34. metadata +17 -7
@@ -3,11 +3,12 @@ require 'imperituroard/projects/iot/internal_functions'
3
3
 
4
4
  class Crm_2
5
5
 
6
- attr_accessor :crm_callback_url, :crm_login, :crm_password, :internal_func, :telegram_connector
6
+ attr_accessor :crm_callback_url, :crm_login, :crm_password, :internal_func, :telegram_connector, :log_level
7
7
 
8
- def initialize(crm_callback_url, crm_login, crm_password, telegram_api_url, telegram_chat_id)
8
+ def initialize(crm_callback_url, crm_login, crm_password, telegram_api_url, telegram_chat_id, log_level)
9
9
  @crm_callback_url = crm_callback_url
10
10
  @crm_login = crm_login
11
+ @log_level = log_level
11
12
  @crm_password = crm_password
12
13
  @internal_func = InternalFunc.new
13
14
  @telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
@@ -44,7 +45,7 @@ class Crm_2
44
45
  :body => {:request_message => crm_payload,
45
46
  :res_code => res.code,
46
47
  :res_body => JSON.parse(res.body.to_s)}}
47
- p res.body
48
+ #p res.body
48
49
  end
49
50
  thr_crm_status_2.join
50
51
 
@@ -52,7 +53,7 @@ class Crm_2
52
53
  output_params = {:code => 500, :result => "Crm_2.crm_status_2: Something wrong", :body => {:request_message => request_message}}
53
54
  telegram_connector.telegram_message(output_params)
54
55
  end
55
- internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Crm_2.crm_status_2"}, "debug")
56
+ internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Crm_2.crm_status_2"}, log_level)
56
57
  output_params
57
58
 
58
59
  end
@@ -30,9 +30,9 @@ class Dabrab
30
30
  image_dat = stri.scan(regexp_image1)
31
31
 
32
32
 
33
- p button_url_dat
34
- p button_text_dat
35
- p image_dat
33
+ #p button_url_dat
34
+ #p button_text_dat
35
+ #p image_dat
36
36
 
37
37
  begin
38
38
  if button_url_dat != [] && button_url_dat != nil && button_url_dat != ""
@@ -90,19 +90,20 @@ class Dabrab
90
90
  scheme = 0
91
91
  end
92
92
 
93
- if scheme==0
94
- sk_format = {"text": text, "ttl": 60}
95
- elsif scheme==1
96
- sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url}
97
- elsif scheme==2
98
- sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url, "img": image}
99
- elsif scheme==3
100
- sk_format = {"img": image, "ttl": 60}
101
- else
102
- nil
93
+ case scheme
94
+ when 0
95
+ sk_format = {"text": text, "ttl": 60}
96
+ when 1
97
+ sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url}
98
+ when 2
99
+ sk_format = {"text": text, "ttl": 60, "caption": button_text, "action": button_url, "img": image}
100
+ when 3
101
+ sk_format = {"img": image, "ttl": 60}
102
+ else
103
+ nil
103
104
  end
104
105
 
105
- p sk_format
106
+ #p sk_format
106
107
 
107
108
  output_answer ={:code => 200, :result => "Success", :body => {:to_sk_format => sk_format, :button_url => button_url, :image => image, :button_text => button_text, :text => text, :scheme => scheme, :scheme_dic => scheme_dic[scheme]}}
108
109
  rescue
@@ -125,11 +126,12 @@ class Dabrab
125
126
  #"extra_id": extra_id
126
127
  })
127
128
  rescue
128
- p "failed: #{g.to_s}"
129
+ nil
130
+ #p "failed: #{g.to_s}"
129
131
  end
130
132
 
131
133
  end
132
- p converted_msisdn_list
134
+ #p converted_msisdn_list
133
135
  converted_msisdn_list
134
136
 
135
137
  end
@@ -155,8 +157,8 @@ class Dabrab
155
157
  ]
156
158
  }
157
159
 
158
- p "send_responce_formatter(hub_answer)"
159
- p hub_answer
160
+ #p "send_responce_formatter(hub_answer)"
161
+ #p hub_answer
160
162
 
161
163
  for a in hub_answer[:body][:res_body]["messages"]
162
164
  status1 = {}
@@ -181,101 +183,164 @@ class Dabrab
181
183
  messages_sect.append(status1)
182
184
  end
183
185
 
184
- p messages_sect
186
+ #p messages_sect
185
187
 
186
188
  mess_to_recip = {"bulkId": "00000000-0000-0000-0000-000000000000", "messages": messages_sect}
187
189
  {:code => 200, :result => "Data processed", :body => {:mess_to_recip => mess_to_recip}}
188
190
  end
189
191
 
190
192
 
191
- def delivery_report_transform(hub_report)
193
+ def delivery_report_transform(hub_report_in)
192
194
  #{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber", "controller"=>"reports", "action"=>"delivery", "report"=>{"number"=>"375297116638", "time"=>1588673492000, "status"=>2, "substatus"=>23, "msg_status"=>23033, "message_id"=>"486649ba-a573-4ee9-8f58-018ed20ca6fd", "extra_id"=>"444/0/ServiceModel/ScGetReports.svc/GetReports", "sent_via"=>"viber"}}
193
- p hub_report
194
- p "hub_report"
195
- data_for_status = {
196
- 23011 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by SMS",
197
- :error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name => "NO_ERROR", :error_descr => "No Error", :error_permanent => false
198
- },
199
- 23033 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by Viber",
200
- :error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name => "NO_ERROR", :error_descr => "No Error", :error_permanent => false
201
- },
202
- 35015 => {:status_id => 15, :status_grid => 4, :status_grname => "EXPIRED", :status_name => "EXPIRED_EXPIRED", :status_descr => "SMS Message TTL EXPIRED",
203
- :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_ABSENT_SUBSCRIBER_SM", :error_descr => "Subscriber is absent", :error_permanent => false
204
- }, #message SMS expired
205
- 36463 => {:status_id => 15, :status_grid => 4, :status_grname => "EXPIRED", :status_name => "EXPIRED_EXPIRED", :status_descr => "Viber Message TTL EXPIRED",
206
- :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_ABSENT_SUBSCRIBER_SM", :error_descr => "Subscriber is absent.", :error_permanent => false
207
- }, #message Viber expired
208
- 36010 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "SMS. Subscriber not exists",
209
- :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
210
- }, #SMS subscriber not exists
211
- 36131 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "SMS. Unknown subscriber",
212
- :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
213
- }, #SMS unknown subscriber
214
- 36505 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "Viber. Subscriber not exists",
215
- :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
216
- } #Viber subscriber not exists
217
- }
195
+ #p hub_report
196
+ #p "hub_report"
197
+ report_to_recip =
198
+
199
+ data_for_status = {
200
+ 23011 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by SMS",
201
+ :error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name => "NO_ERROR", :error_descr => "No Error", :error_permanent => false
202
+ },
203
+ 23033 => {:status_id => 5, :status_grid => 3, :status_grname => "DELIVERED", :status_name => "DELIVERED_TO_HANDSET", :status_descr => "Message delivered by Viber",
204
+ :error_id => 0, :error_grid => 0, :error_grname => "Ok", :error_name => "NO_ERROR", :error_descr => "No Error", :error_permanent => false
205
+ },
206
+ 35015 => {:status_id => 15, :status_grid => 4, :status_grname => "EXPIRED", :status_name => "EXPIRED_EXPIRED", :status_descr => "SMS Message TTL EXPIRED",
207
+ :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_ABSENT_SUBSCRIBER_SM", :error_descr => "Subscriber is absent", :error_permanent => false
208
+ }, #message SMS expired
209
+ 36463 => {:status_id => 15, :status_grid => 4, :status_grname => "EXPIRED", :status_name => "EXPIRED_EXPIRED", :status_descr => "Viber Message TTL EXPIRED",
210
+ :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_ABSENT_SUBSCRIBER_SM", :error_descr => "Subscriber is absent.", :error_permanent => false
211
+ }, #message Viber expired
212
+ 36010 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "SMS. Subscriber not exists",
213
+ :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
214
+ }, #SMS subscriber not exists
215
+ 36131 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "SMS. Unknown subscriber",
216
+ :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
217
+ }, #SMS unknown subscriber
218
+ 36505 => {:status_id => 4, :status_grid => 2, :status_grname => "UNDELIVERABLE", :status_name => "UNDELIVERABLE_REJECTED_OPERATOR", :status_descr => "Viber. Subscriber not exists",
219
+ :error_id => 6, :error_grid => 1, :error_grname => "HANDSET_ERRORS", :error_name => "EC_UNKNOWN_SUBSCRIBER", :error_descr => "Subscriber not found.", :error_permanent => true
220
+ } #Viber subscriber not exists
221
+ }
222
+
223
+ if hub_report_in.key?("msg_status")
224
+ hub_report = hub_report_in
225
+
226
+ if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
227
+ report_to_recip.push({
228
+
229
+ "bulkId": "00000000-0000-0000-0000-000000000000",
230
+ "messageId": hub_report[:report][:message_id],
231
+ "to": hub_report[:report][:number],
232
+ # "sentAt": "2020-05-05T20:00:00.000+0000",
233
+ # "doneAt": "2020-05-05T20:00:00.000+0000",
234
+ "status": {
235
+ "groupId": data_for_status[hub_report[:msg_status]][:status_grid],
236
+ "groupName": data_for_status[hub_report[:msg_status]][:status_grname],
237
+ "id": data_for_status[hub_report[:msg_status]][:status_id],
238
+ "name": data_for_status[hub_report[:msg_status]][:status_name],
239
+ "description": data_for_status[hub_report[:msg_status]][:status_descr]
240
+ },
241
+ "error": {
242
+ "groupId": data_for_status[hub_report[:msg_status]][:error_grid],
243
+ "groupName": data_for_status[hub_report[:msg_status]][:error_grname],
244
+ "id": data_for_status[hub_report[:msg_status]][:error_id],
245
+ "name": data_for_status[hub_report[:msg_status]][:error_name],
246
+ "description": data_for_status[hub_report[:msg_status]][:error_descr],
247
+ "permanent": data_for_status[hub_report[:msg_status]][:error_permanent]
248
+ }
249
+ })
218
250
 
219
- if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
220
- report_to_recip = {
221
- "results": [
222
- {
223
-
224
- "bulkId": "00000000-0000-0000-0000-000000000000",
225
- "messageId": hub_report[:report][:message_id],
226
- "to": hub_report[:report][:number],
227
- # "sentAt": "2020-05-05T20:00:00.000+0000",
228
- # "doneAt": "2020-05-05T20:00:00.000+0000",
229
- "status": {
230
- "groupId": data_for_status[hub_report[:msg_status]][:status_grid],
231
- "groupName": data_for_status[hub_report[:msg_status]][:status_grname],
232
- "id": data_for_status[hub_report[:msg_status]][:status_id],
233
- "name": data_for_status[hub_report[:msg_status]][:status_name],
234
- "description": data_for_status[hub_report[:msg_status]][:status_descr]
235
- },
236
- "error": {
237
- "groupId": data_for_status[hub_report[:msg_status]][:error_grid],
238
- "groupName": data_for_status[hub_report[:msg_status]][:error_grname],
239
- "id": data_for_status[hub_report[:msg_status]][:error_id],
240
- "name": data_for_status[hub_report[:msg_status]][:error_name],
241
- "description": data_for_status[hub_report[:msg_status]][:error_descr],
242
- "permanent": data_for_status[hub_report[:msg_status]][:error_permanent]
243
- }
244
- }
245
- ]
246
- }
251
+
252
+ else
253
+ report_to_recip["results"].app
254
+
255
+ report_to_recip.push({
256
+
257
+ "bulkId": "00000000-0000-0000-0000-000000000000",
258
+ "messageId": hub_report[:report][:message_id],
259
+ "to": hub_report[:report][:number],
260
+ # "sentAt": "2020-05-05T20:00:00.000+0000",
261
+ # "doneAt": "2020-05-05T20:00:00.000+0000",
262
+ "status": {
263
+ "groupId": 2,
264
+ "groupName": "UNDELIVERABLE_NOT_DELIVERED",
265
+ "id": 9,
266
+ "name": "UNDELIVERED",
267
+ "description": "Unknown error"
268
+ },
269
+ "error": {
270
+ "groupId": 1,
271
+ "groupName": "HANDSET_ERRORS",
272
+ "id": 32,
273
+ "name": "EC_SM_DELIVERY_FAILURE",
274
+ "description": "Unknown error",
275
+ "permanent": false
276
+ }
277
+ })
278
+
279
+ end
247
280
 
248
281
  else
249
282
 
250
- report_to_recip = {
251
- "results": [
252
- {
253
-
254
- "bulkId": "00000000-0000-0000-0000-000000000000",
255
- "messageId": hub_report[:report][:message_id],
256
- "to": hub_report[:report][:number],
257
- # "sentAt": "2020-05-05T20:00:00.000+0000",
258
- # "doneAt": "2020-05-05T20:00:00.000+0000",
259
- "status": {
260
- "groupId": 2,
261
- "groupName": "UNDELIVERABLE_NOT_DELIVERED",
262
- "id": 9,
263
- "name": "UNDELIVERED",
264
- "description": "Unknown error"
265
- },
266
- "error": {
267
- "groupId": 1,
268
- "groupName": "HANDSET_ERRORS",
269
- "id": 32,
270
- "name": "EC_SM_DELIVERY_FAILURE",
271
- "description": "Unknown error",
272
- "permanent": false
273
- }
274
- }
275
- ]
283
+ hub_report_in["_json"].each {|hub_report2|
284
+
285
+ if data_for_status[hub_report[:msg_status]] != nil && data_for_status[hub_report[:msg_status]] != {} && data_for_status[hub_report[:msg_status]] != [] && data_for_status[hub_report[:msg_status]] != ""
286
+ report_to_recip.push({
287
+
288
+ "bulkId": "00000000-0000-0000-0000-000000000000",
289
+ "messageId": hub_report2[:message_id],
290
+ "to": hub_report2[:number],
291
+ # "sentAt": "2020-05-05T20:00:00.000+0000",
292
+ # "doneAt": "2020-05-05T20:00:00.000+0000",
293
+ "status": {
294
+ "groupId": data_for_status[hub_report2[:msg_status]][:status_grid],
295
+ "groupName": data_for_status[hub_report2[:msg_status]][:status_grname],
296
+ "id": data_for_status[hub_report2[:msg_status]][:status_id],
297
+ "name": data_for_status[hub_report2[:msg_status]][:status_name],
298
+ "description": data_for_status[hub_report2[:msg_status]][:status_descr]
299
+ },
300
+ "error": {
301
+ "groupId": data_for_status[hub_report2[:msg_status]][:error_grid],
302
+ "groupName": data_for_status[hub_report2[:msg_status]][:error_grname],
303
+ "id": data_for_status[hub_report2[:msg_status]][:error_id],
304
+ "name": data_for_status[hub_report2[:msg_status]][:error_name],
305
+ "description": data_for_status[hub_report2[:msg_status]][:error_descr],
306
+ "permanent": data_for_status[hub_report2[:msg_status]][:error_permanent]
307
+ }
308
+ })
309
+
310
+
311
+ else
312
+ report_to_recip["results"].app
313
+
314
+ report_to_recip.push({
315
+
316
+ "bulkId": "00000000-0000-0000-0000-000000000000",
317
+ "messageId": hub_report2[:message_id],
318
+ "to": hub_report2[:number],
319
+ # "sentAt": "2020-05-05T20:00:00.000+0000",
320
+ # "doneAt": "2020-05-05T20:00:00.000+0000",
321
+ "status": {
322
+ "groupId": 2,
323
+ "groupName": "UNDELIVERABLE_NOT_DELIVERED",
324
+ "id": 9,
325
+ "name": "UNDELIVERED",
326
+ "description": "Unknown error"
327
+ },
328
+ "error": {
329
+ "groupId": 1,
330
+ "groupName": "HANDSET_ERRORS",
331
+ "id": 32,
332
+ "name": "EC_SM_DELIVERY_FAILURE",
333
+ "description": "Unknown error",
334
+ "permanent": false
335
+ }
336
+ })
337
+ end
338
+
276
339
  }
340
+
277
341
  end
278
- {:code => 200, :result => "Data processed", :body => {:report_to_recip => report_to_recip}}
342
+
343
+ {:code => 200, :result => "Data processed", :body => {:report_to_recip => {"results": report_to_recip}}}
279
344
  end
280
345
 
281
346
  end
@@ -0,0 +1,69 @@
1
+ require 'net/https'
2
+
3
+ require 'json'
4
+
5
+ require 'uri'
6
+ require 'net/http'
7
+ require 'rubygems'
8
+ require 'nokogiri'
9
+ require 'rails'
10
+
11
+ require 'imperituroard/projects/iot/internal_functions'
12
+
13
+
14
+ class Gms_2
15
+
16
+ attr_accessor :gms_login, :gms_password, :telegram_connector, :internal_func
17
+
18
+ def initialize(gms_login, gms_password, telegram_api_url, telegram_chat_id)
19
+ @gms_login = gms_login
20
+ @gms_password = gms_password
21
+ @internal_func = InternalFunc.new
22
+ @telegram_connector = Telegram_2.new(telegram_api_url, telegram_chat_id)
23
+ end
24
+
25
+ def get_advanced_by_external(external_id)
26
+
27
+ input_params = {:external_id => external_id}
28
+ output_params = {}
29
+ thr1_get_advanced_by_external = Thread.new do
30
+ begin
31
+ uri = URI("https://dr-v2.hyber.im/2160/api/dr/external/" + external_id + "/advanced")
32
+ https = Net::HTTP.new(uri.host, uri.port)
33
+ https.use_ssl = true
34
+ https.verify_mode = OpenSSL::SSL::VERIFY_NONE
35
+ req = Net::HTTP::Get.new(uri.path, initheader = {:"Content-Type" => 'application/json'})
36
+ req.basic_auth gms_login, gms_password
37
+ req["Content-Type"] = "application/json"
38
+ res = https.request(req)
39
+
40
+ p res.code
41
+ p res.body
42
+ if res.code == "200"
43
+ output_params = {:code => 200,
44
+ :result => "Gms_2.get_advanced_by_external: Request processed",
45
+ :body => {:request_message => input_params,
46
+ :res_code => res.code,
47
+ :res_body => JSON.parse(res.body.to_s)}}
48
+ else
49
+ output_params = {:code => res.code.to_i,
50
+ :result => "Gms_2.get_advanced_by_external: Request processed",
51
+ :body => {:request_message => input_params,
52
+ :res_code => res.code,
53
+ :res_body => res.body.to_s}}
54
+ end
55
+ rescue
56
+ output_params = {:code => 500, :result => "Gms_2.get_advanced_by_external: Something wrong", :body => {:request_message => input_params}}
57
+ end
58
+ end
59
+ thr1_get_advanced_by_external.join
60
+
61
+ internal_func.printer_texter({:input => input_params, :output => output_params, :procedure => "Gms_2.get_advanced_by_external"}, "debug")
62
+ output_params
63
+
64
+ end
65
+
66
+
67
+
68
+
69
+ end
@@ -60,7 +60,7 @@ class Ukaz60All_2
60
60
  else
61
61
  forti_answer = {:code => update_fortigate_ansible[:code], :result => update_fortigate_ansible[:result]}
62
62
  end
63
- #forti_connector.clean_tmp_folders
63
+ forti_connector.clean_tmp_folders
64
64
  else
65
65
  forti_answer = {:code => 401, :result => "Failed for uploading data to ansible server"}
66
66
  end
@@ -85,6 +85,8 @@ class Ukaz60All_2
85
85
  #compare data with belgim
86
86
  answ = ukaz60_add_func.staros_compare_http(staros_blocks_current, get_belgim_data)
87
87
 
88
+ p answ
89
+
88
90
  if answ[:code] == 200
89
91
  #output_starprocess = {:code => 200, :result => "Staros processed", :data => {:block_me => answ[:body][:for_block][:notblocked_stat], :unblock_me =>answ[:body][:for_unblock][:for_unblock_stat]}}
90
92
  output_starprocess = ukaz60_add_func.format_star_processed_answ(answ)[:body][:to_message]
@@ -110,7 +112,7 @@ class Ukaz60All_2
110
112
 
111
113
  begin
112
114
  get_belgim_data = belgim_connector.belgim_ukaz60_get
113
- p get_belgim_data
115
+ #p get_belgim_data
114
116
 
115
117
  if get_belgim_data[:code] == 200
116
118
 
@@ -55,7 +55,7 @@ class Belgim_2
55
55
  curl_belgie_command = "curl -d \"name=#{belgim_login}&pass=#{belgim_password}\" -H \"Content-Type: application/x-www-form-urlencoded\" -X POST #{belgim_url} --insecure"
56
56
  #return_from_belgim = `curl -d "name=#{belgim_login}&pass=#{belgim_password}" -H "Content-Type: application/x-www-form-urlencoded" -X POST #{belgim_url} --insecure`
57
57
  return_from_belgim = `#{curl_belgie_command}`
58
- p curl_belgie_command
58
+ #p curl_belgie_command
59
59
 
60
60
  return_from_belgim = return_from_belgim.gsub!("\n", "")
61
61