-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always write lockfiles for local top-level profiles #1116
Conversation
This is based on #1113 |
8436868
to
d2deed3
Compare
@@ -60,6 +60,8 @@ def self.exec_options | |||
desc: 'Load attributes file (experimental)' | |||
option :cache, type: :string, | |||
desc: 'Use the given path for caching dependencies. (default: ~/.inspec/cache)' | |||
option :no_write_lockfile, type: :boolean, default: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is leading to a strange cli output:
[--no-write-lockfile], [--no-no-write-lockfile] # Do not write out a lockfile based on this execution
I think we need to switch to write-lockfile
with default true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe create-lockfile
, since otherwise I am thinking its overwriting the old lockfile
@@ -55,6 +55,10 @@ def archive_path | |||
@target | |||
end | |||
|
|||
def writable? | |||
File.directory?(@target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all directories are writable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, in this context by writable? we simply mean "is this the type of source that I actually want to write new files into on disk". We may still fail with EACCESS or something when we go to write.
if profile.lockfile_exists? | ||
Inspec::Log.debug "Using existing lockfile #{profile.lockfile_path}" | ||
else | ||
Inspec::Log.debug "Writing lockfile: #{profile.lockfile_path}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Writing
== Creating
?
This commit threads through some state related to whether or not a profile is "local", that is whether it is a directory on disk. If it is, we then write out the lockfile to disk. Signed-off-by: Steven Danna <steve@chef.io>
Signed-off-by: Steven Danna <steve@chef.io>
b70a9fa
to
d29e876
Compare
Thanks @stevendanna |
This commit threads through some state related to whether or not a
profile is "local", that is whether it is a directory on disk. If it
is, we then write out the lockfile to disk.
Signed-off-by: Steven Danna steve@chef.io