Skip to content

Commit 56d5c49

Browse files
committed
host was no associated with the workspace
* searching mdm host by wspace id instead
1 parent 1378e2e commit 56d5c49

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/msf/core/db_manager/import.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ def import(args={}, &block)
9494
yield(:filetype, @import_filedata[:type]) if block
9595
self.send "import_#{ftype}".to_sym, args, &block
9696
if preserve_hosts
97-
new_host_ids = wspace.hosts.map(&:id)
97+
new_host_ids = Mdm::Host.where(workspace: wspace).map(&:id)
9898
(new_host_ids - existing_host_ids).each do |id|
99-
wspace.hosts.where(id: id).first.normalize_os
99+
Mdm::Host.where(id: id).first.normalize_os
100100
end
101101
else
102-
wspace.hosts.each(&:normalize_os)
102+
Mdm::Host.where(workspace: wspace).each(&:normalize_os)
103103
end
104104
wspace.update_attribute(:import_fingerprint, false)
105105
end

0 commit comments

Comments
 (0)