File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
ui/console/command_dispatcher Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,11 @@ def report_loot(opts)
97
97
# @param opts [Hash] Hash containing the updated values. Key should match the attribute to update. Must contain :id of record to update.
98
98
# @return [Mdm::Loot] The updated Mdm::Loot object.
99
99
def update_loot ( opts )
100
- # TODO: remove unneeded workspace from opts until it's not automatically added to remote requests
101
- opts . delete ( :workspace )
100
+ wspace = opts . delete ( :workspace )
101
+ if wspace . kind_of? String
102
+ wspace = find_workspace ( wspace )
103
+ opts [ :workspace ] = wspace
104
+ end
102
105
103
106
::ActiveRecord ::Base . connection_pool . with_connection {
104
107
id = opts . delete ( :id )
Original file line number Diff line number Diff line change @@ -1145,7 +1145,7 @@ def cmd_loot(*args)
1145
1145
print_error ( "Can't make loot with no info" )
1146
1146
return
1147
1147
end
1148
- when '-t'
1148
+ when '-t' , '--type'
1149
1149
typelist = args . shift
1150
1150
if ( !typelist )
1151
1151
print_error ( "Invalid type list" )
@@ -1211,6 +1211,8 @@ def cmd_loot(*args)
1211
1211
loots = loots + framework . db . loots ( framework . db . workspace , { :search_term => search_term } )
1212
1212
else
1213
1213
each_host_range_chunk ( host_ranges ) do |host_search |
1214
+ break if !host_search . nil? && host_search . empty?
1215
+
1214
1216
loots = loots + framework . db . loots ( framework . db . workspace , { :hosts => { :address => host_search } , :search_term => search_term } )
1215
1217
end
1216
1218
end
@@ -1222,7 +1224,6 @@ def cmd_loot(*args)
1222
1224
if mode == :update
1223
1225
begin
1224
1226
loot . info = info if info
1225
- loot . filename = filename if filename
1226
1227
if types . size > 1
1227
1228
print_error "May only pass 1 type when performing an update."
1228
1229
next
You can’t perform that action at this time.
0 commit comments