imperituroard 1.1.5 → 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/runConfigurations/autovpn.xml +21 -0
- data/.idea/runConfigurations/dabrab_proced.xml +21 -0
- data/.idea/runConfigurations/test9_dab.xml +21 -0
- data/imperituroard.gemspec +1 -1
- data/lib/.DS_Store +0 -0
- data/lib/imperituroard.rb +57 -5
- data/lib/imperituroard/.DS_Store +0 -0
- data/lib/imperituroard/add_functions/logger/any_functions.rb +4 -2
- data/lib/imperituroard/platforms/iwag/get_iwag_data.rb +90 -0
- data/lib/imperituroard/platforms/iwag/iwag_database_worker.rb +24 -0
- data/lib/imperituroard/platforms/iwag/iwag_telnet_connector.rb +112 -0
- data/lib/imperituroard/platforms/staros/staros_automation.rb +1 -1
- data/lib/imperituroard/projects/autovpn.rb +27 -0
- data/lib/imperituroard/projects/{vpn/ezuev_fun → autovpn}/functions_ezuev.rb +0 -0
- data/lib/imperituroard/projects/autovpn/mongo_vpn.rb +56 -0
- data/lib/imperituroard/projects/iot.rb +1 -1
- data/lib/imperituroard/projects/iot/add_functions.rb +2 -2
- data/lib/imperituroard/projects/iot/hua_oceanconnect_adapter.rb +25 -21
- data/lib/imperituroard/projects/iot/internal_functions.rb +5 -4
- data/lib/imperituroard/projects/mhub.rb +68 -14
- data/lib/imperituroard/projects/mhub/gms.rb +96 -0
- data/lib/imperituroard/projects/mhub/sk.rb +26 -18
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb +5 -4
- data/lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb +165 -100
- data/lib/imperituroard/projects/mhub/subs/evrotorg/gms_connector.rb +69 -0
- data/lib/imperituroard/projects/ukaz60.rb +4 -2
- data/lib/imperituroard/projects/ukaz60/belgim.rb +1 -1
- data/lib/imperituroard/projects/ukaz60/fortigate.rb +1 -1
- data/lib/imperituroard/projects/ukaz60/staros.rb +5 -5
- data/lib/imperituroard/projects/ukaz60/ukaz60_add_func.rb +50 -4
- data/lib/imperituroard/projects/wttx/updatepostcps.rb +7 -7
- data/lib/imperituroard/version.rb +1 -1
- metadata +17 -7
@@ -113,7 +113,7 @@ class FortiUkaz60_2
|
|
113
113
|
p "ansible_answer: #{ansible_answer}"
|
114
114
|
|
115
115
|
#hh = "\nPLAY [ha_master] ***************************************************************\n\nTASK [set url table] ***********************************************************\nchanged: [gom32sg1]\nchanged: [bre32sg1]\nchanged: [min32sg1]\nchanged: [vit32sg1]\nchanged: [min32sg3]\nchanged: [gro32sg1]\nchanged: [mog32sg1]\n\nTASK [check current url table] *************************************************\nok: [min32sg1]\nok: [bre32sg1]\nok: [min32sg3]\nok: [vit32sg1]\nok: [gom32sg1]\nok: [gro32sg1]\nok: [mog32sg1]\n\nTASK [debug] *******************************************************************\nok: [min32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [min32sg3] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [bre32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [vit32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [gom32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [gro32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\nok: [mog32sg1] => {\n \"msg\": \"URL loaded/in-file: [1273 / 1273]\"\n}\n\nPLAY RECAP *********************************************************************\nbre32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \ngom32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \ngro32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \nmin32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \nmin32sg3 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \nmog32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \nvit32sg1 : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 \n\n"
|
116
|
-
answ_pr = add_func_connector.
|
116
|
+
answ_pr = add_func_connector.ansible_answer_parse_fmg(ansible_answer)
|
117
117
|
output_data = {:code => 200, :result => "update_weburl_fortigate: Request completed", :body => answ_pr}
|
118
118
|
rescue
|
119
119
|
output_data = {:code => 507, :result => "update_weburl_fortigate: Unknown SDK error"}
|
@@ -129,13 +129,13 @@ class Ukaz60Staros_2
|
|
129
129
|
end
|
130
130
|
|
131
131
|
|
132
|
-
uu ="/fgd?ef"
|
132
|
+
#uu ="/fgd?ef"
|
133
133
|
|
134
134
|
#ggg = uu.force_encoding('ASCII-8BIT')
|
135
135
|
#puts CGI.escape ggg
|
136
|
-
p url_encode("foo/bar? baz&")
|
136
|
+
#p url_encode("foo/bar? baz&")
|
137
137
|
|
138
|
-
p URI.parse("foo/bar? baz&").to_s
|
139
|
-
p URI::encode("foo/bar? baz&")
|
138
|
+
#p URI.parse("foo/bar? baz&").to_s
|
139
|
+
#p URI::encode("foo/bar? baz&")
|
140
140
|
|
141
|
-
p URI.decode("newsx-ru.ru/by/251-potencia-spartagen-by/%3futm%20medium=251&utmcampaign=4&%20utm%20content=57849345&utm%20source=56960717")
|
141
|
+
#p URI.decode("newsx-ru.ru/by/251-potencia-spartagen-by/%3futm%20medium=251&utmcampaign=4&%20utm%20content=57849345&utm%20source=56960717")
|
@@ -154,6 +154,52 @@ class AddFuncUkaz60_2
|
|
154
154
|
end
|
155
155
|
|
156
156
|
|
157
|
+
def ansible_answer_parse_fmg(answer_string)
|
158
|
+
input_data = {:answer_string => answer_string}
|
159
|
+
output_data = {}
|
160
|
+
|
161
|
+
begin
|
162
|
+
answ_ans_parsed = answer_string.gsub("\n", " ")
|
163
|
+
result_out = {}
|
164
|
+
#result_out = []
|
165
|
+
num_ok = 0
|
166
|
+
num_failed = 0
|
167
|
+
#final_checks = /(fortimanager1)\s+:\s+ok=(\d)\s+changed=(\d)\s+unreachable=(\d)\s+failed=(\d)\s+/
|
168
|
+
final_checks = /(fortimanager1)\s+:\s+ok=(\d+)\s+changed=(\d+)\s+unreachable=(\d+)\s+failed=(\d+)\s+/
|
169
|
+
|
170
|
+
#p answ_ans_parsed
|
171
|
+
processed_data = answ_ans_parsed.scan(final_checks)
|
172
|
+
#p processed_data
|
173
|
+
if processed_data!=[] && processed_data!=""
|
174
|
+
for aaa in processed_data
|
175
|
+
begin
|
176
|
+
if aaa[1].to_i>0 && aaa[3].to_i==0 && aaa[4].to_i==0
|
177
|
+
result_out[aaa[0]] = {:ok => aaa[1], :changed => aaa[2], :unreachable => aaa[3], :failed => aaa[4], :result => "Ok"}
|
178
|
+
#result_out.push({aaa[0] => "Ok"})
|
179
|
+
num_ok = num_ok + 1
|
180
|
+
else
|
181
|
+
result_out[aaa[0]] = {:ok => aaa[1], :unreachable => aaa[3], :failed => aaa[4], :result => "Failed"}
|
182
|
+
#result_out.push({aaa[0] => "Failed"})
|
183
|
+
num_failed = num_failed + 1
|
184
|
+
end
|
185
|
+
rescue
|
186
|
+
result_out["unknown"] = aaa.to_s
|
187
|
+
#result_out.push({"unknown" => aaa.to_s})
|
188
|
+
num_failed = num_failed + 1
|
189
|
+
end
|
190
|
+
end
|
191
|
+
output_data = {:code => 200, :result => "ansible_answer_parse: Request completed successfully", :body => {:list => result_out, :num_ok => num_ok, :num_failed => num_failed}}
|
192
|
+
else
|
193
|
+
output_data = {:code => 400, :result => "ansible_answer_parse: Ansible returned empty data"}
|
194
|
+
end
|
195
|
+
rescue
|
196
|
+
output_data = {:code => 507, :result => "ansible_answer_parse: Unknown error"}
|
197
|
+
end
|
198
|
+
add_functions.printer_texter(output_data, "debug")
|
199
|
+
output_data
|
200
|
+
end
|
201
|
+
|
202
|
+
|
157
203
|
def https_to_forti_prep(domain)
|
158
204
|
f0 = domain.gsub("#", "")
|
159
205
|
f1 = f0.gsub("https://", "").split("/")
|
@@ -248,10 +294,10 @@ class AddFuncUkaz60_2
|
|
248
294
|
end
|
249
295
|
|
250
296
|
#p JSON.pretty_generate(output_answ)
|
251
|
-
p "staros_compare_http"
|
252
|
-
p output_answ
|
297
|
+
#p "staros_compare_http"
|
298
|
+
#p output_answ
|
253
299
|
|
254
|
-
p "temp data"
|
300
|
+
#p "temp data"
|
255
301
|
for i in output_answ[:body][:for_unblock][:for_unblock]["vit11asr2"]
|
256
302
|
#for i in output_answ[:body][:for_block][:not_blocked_belgim]["vit11asr2"]
|
257
303
|
p i
|
@@ -280,7 +326,7 @@ class AddFuncUkaz60_2
|
|
280
326
|
end
|
281
327
|
end
|
282
328
|
|
283
|
-
p notbl_equal
|
329
|
+
#p notbl_equal
|
284
330
|
if notbl_equal == 0
|
285
331
|
block_me = {:for_block_count => data[:body][:for_block][:notblocked_stat][compa_n_data]}
|
286
332
|
unblock_me = {:for_unblock_count => data[:body][:for_unblock][:for_unblock_stat][compa_n_data]}
|
@@ -45,25 +45,25 @@ class StateWTTX
|
|
45
45
|
http = Net::HTTP.new(uri.host, uri.port)
|
46
46
|
response = http.request(Net::HTTP::Get.new(uri.request_uri))
|
47
47
|
p content = response.body
|
48
|
-
p
|
48
|
+
p result_code = response.to_s.include?("OK")
|
49
49
|
#Rails.logger = Logger.new(STDOUT)
|
50
50
|
#logger.info "WTTX service getrestCPS result code: #{response.to_s}"
|
51
51
|
#logger.info "WTTX service getrestCPS soap body: #{content.to_s}"
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
if
|
55
|
+
if !result_code
|
56
56
|
"false"
|
57
57
|
else
|
58
|
-
|
59
|
-
|
58
|
+
reg_imsi = /<field code=\"imsi\" value=\"([0-9]{10,15})\"/
|
59
|
+
reg_imei = /<field code=\"imei\" value=\"([0-9]{10,17})\"/
|
60
60
|
|
61
|
-
m1 =
|
62
|
-
m2 =
|
61
|
+
m1 = reg_imsi.match(content)
|
62
|
+
m2 = reg_imei.match(content)
|
63
63
|
imsi = m1[1]
|
64
64
|
imei = m2[1]
|
65
65
|
|
66
|
-
res =
|
66
|
+
res = result_code.to_s + " " + imsi + " " + imei
|
67
67
|
p res
|
68
68
|
res
|
69
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imperituroard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dzmitry Buynovskiy
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -186,7 +186,10 @@ extensions: []
|
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
188
|
- ".gitignore"
|
189
|
+
- ".idea/runConfigurations/autovpn.xml"
|
190
|
+
- ".idea/runConfigurations/dabrab_proced.xml"
|
189
191
|
- ".idea/runConfigurations/hua_oceanconnect_adapter.xml"
|
192
|
+
- ".idea/runConfigurations/test9_dab.xml"
|
190
193
|
- ".idea/runConfigurations/version.xml"
|
191
194
|
- ".ruby-gemset"
|
192
195
|
- ".ruby-version"
|
@@ -206,11 +209,17 @@ files:
|
|
206
209
|
- lib/imperituroard/platforms/cps/cps_multiple_thread_req.rb
|
207
210
|
- lib/imperituroard/platforms/cps/qps_connector.rb
|
208
211
|
- lib/imperituroard/platforms/cps/request_formatter.rb
|
212
|
+
- lib/imperituroard/platforms/iwag/get_iwag_data.rb
|
213
|
+
- lib/imperituroard/platforms/iwag/iwag_database_worker.rb
|
214
|
+
- lib/imperituroard/platforms/iwag/iwag_telnet_connector.rb
|
209
215
|
- lib/imperituroard/platforms/public/telegram.rb
|
210
216
|
- lib/imperituroard/platforms/staros/get_data_ssh.rb
|
211
217
|
- lib/imperituroard/platforms/staros/staros_automation.rb
|
212
218
|
- lib/imperituroard/platforms/staros/staros_automation_fun.rb
|
213
219
|
- lib/imperituroard/platforms/staros/staros_parser.rb
|
220
|
+
- lib/imperituroard/projects/autovpn.rb
|
221
|
+
- lib/imperituroard/projects/autovpn/functions_ezuev.rb
|
222
|
+
- lib/imperituroard/projects/autovpn/mongo_vpn.rb
|
214
223
|
- lib/imperituroard/projects/dns.rb
|
215
224
|
- lib/imperituroard/projects/iot.rb
|
216
225
|
- lib/imperituroard/projects/iot/add_functions.rb
|
@@ -218,10 +227,12 @@ files:
|
|
218
227
|
- lib/imperituroard/projects/iot/internal_functions.rb
|
219
228
|
- lib/imperituroard/projects/iot/mongoconnector.rb
|
220
229
|
- lib/imperituroard/projects/mhub.rb
|
230
|
+
- lib/imperituroard/projects/mhub/gms.rb
|
221
231
|
- lib/imperituroard/projects/mhub/infobip.rb
|
222
232
|
- lib/imperituroard/projects/mhub/sk.rb
|
223
233
|
- lib/imperituroard/projects/mhub/subs/dabrab/dabrab_platform.rb
|
224
234
|
- lib/imperituroard/projects/mhub/subs/dabrab/dabrab_proced.rb
|
235
|
+
- lib/imperituroard/projects/mhub/subs/evrotorg/gms_connector.rb
|
225
236
|
- lib/imperituroard/projects/ukaz60.rb
|
226
237
|
- lib/imperituroard/projects/ukaz60/belgim.rb
|
227
238
|
- lib/imperituroard/projects/ukaz60/dns.rb
|
@@ -229,7 +240,6 @@ files:
|
|
229
240
|
- lib/imperituroard/projects/ukaz60/fortigate.rb
|
230
241
|
- lib/imperituroard/projects/ukaz60/staros.rb
|
231
242
|
- lib/imperituroard/projects/ukaz60/ukaz60_add_func.rb
|
232
|
-
- lib/imperituroard/projects/vpn/ezuev_fun/functions_ezuev.rb
|
233
243
|
- lib/imperituroard/projects/wttx/phpipamcps.rb
|
234
244
|
- lib/imperituroard/projects/wttx/phpipamdb.rb
|
235
245
|
- lib/imperituroard/projects/wttx/updatepostcps.rb
|
@@ -242,7 +252,7 @@ metadata:
|
|
242
252
|
homepage_uri: https://rubygems.org/
|
243
253
|
source_code_uri: https://github.com/imperituroard/imperituroard
|
244
254
|
changelog_uri: https://rubygems.org/
|
245
|
-
post_install_message:
|
255
|
+
post_install_message:
|
246
256
|
rdoc_options: []
|
247
257
|
require_paths:
|
248
258
|
- lib
|
@@ -257,9 +267,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
267
|
- !ruby/object:Gem::Version
|
258
268
|
version: '0'
|
259
269
|
requirements: []
|
260
|
-
rubyforge_project:
|
270
|
+
rubyforge_project:
|
261
271
|
rubygems_version: 2.6.14
|
262
|
-
signing_key:
|
272
|
+
signing_key:
|
263
273
|
specification_version: 4
|
264
274
|
summary: imperituroard gem
|
265
275
|
test_files: []
|