RPC calls in the models should be wrapped
Sometimes we're not talking RPC, and the model shouldn't stack trace in those cases.unstable
parent
4bcbdc54c9
commit
4b943c8769
|
@ -13,8 +13,8 @@ module MetasploitDataModels::ActiveRecordModels::Loot
|
|||
private
|
||||
|
||||
def delete_file
|
||||
c = Pro::Client.get
|
||||
c.loot_delete_file(self[:id])
|
||||
c = Pro::Client.get rescue nil
|
||||
c.loot_delete_file(self[:id]) if c
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -16,8 +16,8 @@ module MetasploitDataModels::ActiveRecordModels::Report
|
|||
private
|
||||
|
||||
def delete_file
|
||||
c = Pro::Client.get
|
||||
c.report_delete_file(self[:id])
|
||||
c = Pro::Client.get rescue nil
|
||||
c.report_delete_file(self[:id]) if c
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -9,8 +9,8 @@ module MetasploitDataModels::ActiveRecordModels::ReportTemplate
|
|||
private
|
||||
|
||||
def delete_file
|
||||
c = Pro::Client.get
|
||||
c.report_template_delete_file(self[:id])
|
||||
c = Pro::Client.get rescue nil
|
||||
c.report_template_delete_file(self[:id]) if c
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ module MetasploitDataModels::ActiveRecordModels::Session
|
|||
private
|
||||
|
||||
def stop
|
||||
c = Pro::Client.get
|
||||
c = Pro::Client.get rescue nil
|
||||
c.session_stop(self.local_id) rescue nil # ignore exceptions (XXX - ideally, stopped an already-stopped session wouldn't throw XMLRPCException)
|
||||
end
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@ module MetasploitDataModels::ActiveRecordModels::Task
|
|||
private
|
||||
|
||||
def delete_file
|
||||
c = Pro::Client.get
|
||||
c.task_delete_log(self[:id])
|
||||
c = Pro::Client.get rescue nil
|
||||
c.task_delete_log(self[:id]) if c
|
||||
end
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue