Skip to content

Commit 3c0ce8e

Browse files
committed
Fix some rubocop complaints
1 parent 7f839a0 commit 3c0ce8e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/msf/core/rpc/v10/rpc_plugin.rb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,32 +17,32 @@ class RPC_Plugin < RPC_Base
1717
# # Load the nexpose plugin
1818
# rpc.call('plugin.load', 'nexpose')
1919
def rpc_load(path, xopts = {})
20-
opts = {}
20+
opts = {}
2121

22-
xopts.each do |k,v|
22+
xopts.each do |k, v|
2323
if k.class == String
2424
opts[k.to_sym] = v
2525
end
2626
end
2727

28-
if (path !~ /#{File::SEPARATOR}/)
28+
if path !~ /#{File::SEPARATOR}/
2929
plugin_file_name = path
3030

3131
# If the plugin isn't in the user direcotry (~/.msf3/plugins/), use the base
3232
path = Msf::Config.user_plugin_directory + File::SEPARATOR + plugin_file_name
33-
if not File.exist?( path + ".rb" )
33+
if not File.exist?(path + ".rb")
3434
# If the following "path" doesn't exist it will be caught when we attempt to load
3535
path = Msf::Config.plugin_directory + File::SEPARATOR + plugin_file_name
3636
end
3737
end
3838

3939
begin
40-
if (inst = self.framework.plugins.load(path, opts))
41-
return { "result" => "success" }
40+
if self.framework.plugins.load(path, opts)
41+
return { "result" => "success" }
4242
end
4343
rescue ::Exception => e
44-
elog("Error loading plugin #{path}: #{e}\n\n#{e.backtrace.join("\n")}", src = 'core', level = 0, from = caller)
45-
return { "result" => "failure" }
44+
elog("Error loading plugin #{path}: #{e}\n\n#{e.backtrace.join("\n")}", 'core', 0, caller)
45+
return { "result" => "failure" }
4646
end
4747

4848
end
@@ -63,10 +63,10 @@ def rpc_unload(name)
6363
# Unload the plugin if it matches the name we're searching for
6464
if plugin
6565
self.framework.plugins.unload(plugin)
66-
return { "result" => "success" }
66+
return { "result" => "success" }
6767
end
6868

69-
return { "result" => "failure" }
69+
{ "result" => "failure" }
7070
end
7171

7272

@@ -79,7 +79,7 @@ def rpc_unload(name)
7979
def rpc_loaded
8080
ret = {}
8181
ret[:plugins] = []
82-
self.framework.plugins.each do |plugin|
82+
self.framework.plugins.each do |plugin|
8383
ret[:plugins] << plugin.name
8484
end
8585
ret

0 commit comments

Comments
 (0)