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
|
private
|
||||||
|
|
||||||
def delete_file
|
def delete_file
|
||||||
c = Pro::Client.get
|
c = Pro::Client.get rescue nil
|
||||||
c.loot_delete_file(self[:id])
|
c.loot_delete_file(self[:id]) if c
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,8 +16,8 @@ module MetasploitDataModels::ActiveRecordModels::Report
|
||||||
private
|
private
|
||||||
|
|
||||||
def delete_file
|
def delete_file
|
||||||
c = Pro::Client.get
|
c = Pro::Client.get rescue nil
|
||||||
c.report_delete_file(self[:id])
|
c.report_delete_file(self[:id]) if c
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,8 +9,8 @@ module MetasploitDataModels::ActiveRecordModels::ReportTemplate
|
||||||
private
|
private
|
||||||
|
|
||||||
def delete_file
|
def delete_file
|
||||||
c = Pro::Client.get
|
c = Pro::Client.get rescue nil
|
||||||
c.report_template_delete_file(self[:id])
|
c.report_template_delete_file(self[:id]) if c
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -18,7 +18,7 @@ module MetasploitDataModels::ActiveRecordModels::Session
|
||||||
private
|
private
|
||||||
|
|
||||||
def stop
|
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)
|
c.session_stop(self.local_id) rescue nil # ignore exceptions (XXX - ideally, stopped an already-stopped session wouldn't throw XMLRPCException)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,8 @@ module MetasploitDataModels::ActiveRecordModels::Task
|
||||||
private
|
private
|
||||||
|
|
||||||
def delete_file
|
def delete_file
|
||||||
c = Pro::Client.get
|
c = Pro::Client.get rescue nil
|
||||||
c.task_delete_log(self[:id])
|
c.task_delete_log(self[:id]) if c
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue