Merge pull request #9917 from chrisroberts/f-smb-garbage
Fix SMB information generation when using net share
This commit is contained in:
commit
4bf8fe1463
|
@ -38,7 +38,7 @@ module VagrantPlugins
|
||||||
|
|
||||||
m_id = machine_id(machine)
|
m_id = machine_id(machine)
|
||||||
prune_shares = existing_shares.map do |share_name, share_info|
|
prune_shares = existing_shares.map do |share_name, share_info|
|
||||||
if share_info["Description"].start_with?("vgt-#{m_id}-")
|
if share_info["Description"].to_s.start_with?("vgt-#{m_id}-")
|
||||||
@@logger.info("removing smb share name=#{share_name} id=#{m_id}")
|
@@logger.info("removing smb share name=#{share_name} id=#{m_id}")
|
||||||
share_name
|
share_name
|
||||||
else
|
else
|
||||||
|
@ -159,6 +159,8 @@ module VagrantPlugins
|
||||||
share_names = result.strip.split("\n").map do |line|
|
share_names = result.strip.split("\n").map do |line|
|
||||||
line.strip.split(/\s+/).first
|
line.strip.split(/\s+/).first
|
||||||
end
|
end
|
||||||
|
# Last item is command completion notification so remove it
|
||||||
|
share_names.pop
|
||||||
shares = {}
|
shares = {}
|
||||||
share_names.each do |share_name|
|
share_names.each do |share_name|
|
||||||
shares[share_name] = {}
|
shares[share_name] = {}
|
||||||
|
|
|
@ -31,7 +31,7 @@ Share name Resource Remark
|
||||||
vgt-CUSTOM_ID-1 /a/path vgt-CUSTOM_ID-1
|
vgt-CUSTOM_ID-1 /a/path vgt-CUSTOM_ID-1
|
||||||
vgt-CUSTOM_ID-2 /other/path vgt-CUSTOM_ID-2
|
vgt-CUSTOM_ID-2 /other/path vgt-CUSTOM_ID-2
|
||||||
my-share /my/path Not Vagran...
|
my-share /my/path Not Vagran...
|
||||||
|
The command completed successfully.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
let(:netshare1){ <<-EOF
|
let(:netshare1){ <<-EOF
|
||||||
|
|
Loading…
Reference in New Issue