Skip to content

Commit 1d6f088

Browse files
committed
Pass msftidy
1 parent 526538e commit 1d6f088

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

modules/post/multi/gather/dbvis_enum.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(info={})
2929
def run
3030

3131

32-
oldversion= false
32+
oldversion = false
3333

3434
case session.platform
3535
when /linux/
@@ -38,7 +38,7 @@ def run
3838
if (user =~ /root/)
3939
user_base = "/root/"
4040
else
41-
user_base="/home/#{user}/"
41+
user_base = "/home/#{user}/"
4242
end
4343
dbvis_file = "#{user_base}.dbvis/config70/dbvis.xml"
4444
when /win/
@@ -52,25 +52,25 @@ def run
5252

5353

5454
unless file?(dbvis_file)
55-
#File not found, we next try with the old config path
55+
# File not found, we next try with the old config path
5656
print_status("File not found: #{dbvis_file}")
5757
print_status("This could be an older version of dbvis, trying old path")
5858
case session.platform
5959
when /linux/
60-
dbvis_file = "#{user_base}.dbvis/config/dbvis.xml"
60+
dbvis_file = "#{user_base}.dbvis/config/dbvis.xml"
6161
when /win/
62-
dbvis_file = user_profile + "\\.dbvis\\config\\dbvis.xml"
62+
dbvis_file = user_profile + "\\.dbvis\\config\\dbvis.xml"
6363
end
6464
unless file?(dbvis_file)
6565
print_error("File not found: #{dbvis_file}")
6666
return
6767
end
68-
oldversion= true
68+
oldversion = true
6969
end
7070

7171

72-
print_status("Reading: #{dbvis_file}")
73-
print_line()
72+
print_status("Reading: #{dbvis_file}")
73+
print_line()
7474
raw_xml = ""
7575
begin
7676
raw_xml = read_file(dbvis_file)
@@ -79,13 +79,13 @@ def run
7979
print_error("Nothing read from file: #{dbvis_file}, file may be empty")
8080
return
8181
end
82-
82+
8383
if oldversion
8484
# Parse old config file
85-
db_table=pareseOldConfigFile(raw_xml)
85+
db_table = pareseOldConfigFile(raw_xml)
8686
else
8787
# Parse new config file
88-
db_table=pareseNewConfigFile(raw_xml)
88+
db_table = pareseNewConfigFile(raw_xml)
8989
end
9090

9191
if db_table.rows.empty?
@@ -128,7 +128,7 @@ def pareseNewConfigFile(raw_xml)
128128
"Namespace",
129129
"Userid",
130130
])
131-
131+
132132
dbs = []
133133
db = {}
134134
dbfound = false
@@ -143,7 +143,7 @@ def pareseNewConfigFile(raw_xml)
143143
if line =~ /<Database id=/
144144
dbfound = true
145145
elsif line =~ /<\/Database>/
146-
dbfound=false
146+
dbfound = false
147147
if db[:Database].nil?
148148
db[:Database] = "";
149149
end
@@ -193,7 +193,7 @@ def pareseNewConfigFile(raw_xml)
193193
end
194194
end
195195

196-
# FIll the tab and report eligible servers
196+
# Fill the tab and report eligible servers
197197
dbs.each do |db|
198198
if ::Rex::Socket.is_ipv4?(db[:Server].to_s)
199199
print_good("Reporting #{db[:Server]} ")
@@ -219,7 +219,7 @@ def pareseOldConfigFile(raw_xml)
219219
"Url",
220220
"Userid",
221221
])
222-
222+
223223
dbs = []
224224
db = {}
225225
dbfound = false
@@ -235,7 +235,7 @@ def pareseOldConfigFile(raw_xml)
235235
if line =~ /<Database id=/
236236
dbfound = true
237237
elsif line =~ /<\/Database>/
238-
dbfound=false
238+
dbfound = false
239239
# save
240240
dbs << db if (db[:Alias] and db[:Url] )
241241
db = {}
@@ -268,9 +268,9 @@ def pareseOldConfigFile(raw_xml)
268268
dbs.each do |db|
269269
if (db[:Url] =~ /[\S+\s+]+[\/]+([\S+\s+]+):[\S+]+/i)
270270
if ::Rex::Socket.is_ipv4?($1.to_s)
271-
print_good("Reporting #{$1} ")
272-
report_host(:host => $1.to_s);
273-
end
271+
print_good("Reporting #{$1}")
272+
report_host(:host => $1.to_s)
273+
end
274274
end
275275
db_table << [ db[:Alias] , db[:Type] , db[:Url], db[:Userid] ]
276276
end
@@ -279,12 +279,12 @@ def pareseOldConfigFile(raw_xml)
279279

280280

281281
def findVersion(tag)
282-
found=false
283-
if (tag =~ /<Version>([\S+\s+]+)<\/Version>/i)
284-
print_good("DbVisualizer version : #{$1} ")
285-
found=true
286-
end
287-
return found
282+
found = false
283+
if (tag =~ /<Version>([\S+\s+]+)<\/Version>/i)
284+
print_good("DbVisualizer version : #{$1}")
285+
found = true
286+
end
287+
return found
288288
end
289289

290290
end

0 commit comments

Comments
 (0)