Create required directories before creating a file
Change-Id: Iceac5103fa7512aeb2a9e10d7e573a200f3c33e3 Closes-bug: #1456895
This commit is contained in:
parent
d1706534d4
commit
79f9135697
|
@ -16,6 +16,7 @@
|
|||
require "json"
|
||||
require "base64"
|
||||
require 'fileutils'
|
||||
require 'pathname'
|
||||
|
||||
module MCollective
|
||||
module Agent
|
||||
|
@ -168,6 +169,7 @@ module MCollective
|
|||
def prevent_discover
|
||||
lock_path = AGENT_NODISCOVER_FILE
|
||||
debug_msg("Create file for discovery preventing #{lock_path}")
|
||||
FileUtils.mkdir_p(Pathname.new(lock_path).dirname)
|
||||
FileUtils.touch(lock_path)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue