-
Notifications
You must be signed in to change notification settings - Fork 39
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
Respect build_dir from resource #415
base: master
Are you sure you want to change the base?
Conversation
fffea36
to
4150cab
Compare
@@ -51,6 +51,6 @@ def req_file | |||
end | |||
|
|||
def build_path(file_name = '') | |||
self.class.build_path(File.join(resource[:hostname], file_name)) | |||
self.class.build_path(File.join(resource[:hostname], file_name), resource[:build_dir]) |
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.
Wouldn't this technically be equal to:
self.class.build_path(File.join(resource[:hostname], file_name), resource[:build_dir]) | |
super(File.join(resource[:hostname], file_name)) |
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.
I believe so, and could be considered as a re-factor to code that I'd do as a follow up across a few files.
end | ||
|
||
def self.build_path(file_name = '') | ||
File.join("/root/ssl-build", file_name) | ||
def self.build_path(file_name = '', build_dir) |
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.
I see a few places where self.build_path
is called. We should get rid of those.
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.
Yes, there is an over-use of self
throughout that I would tackle as a re-factor after I do some other clean up first.
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.
I also did some of that when I tried to understand this PR. I think #418 is at least one clean up that can already happen.
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.
For example, I can now rip out all of the RPM generation and handling code since we've been running based on just the files from a deployment stand-point for a few release now. And that may end up cleaning out a lot of code. So I'd revisit re-factor after I do that.
4150cab
to
a421b91
Compare
@ekohl Good with this change and saving the some of the re-factoring for some follow on work? |
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.
I was trying to get rid of the static method, but the inheritance does make it hard. I think there is one case that still uses it:
puppet-certs/lib/puppet/provider/ca/katello_ssl_tool.rb
Lines 56 to 58 in 027e2cb
def self.privkey(name) | |
build_path("#{name}.key") | |
end |
Wouldn't that part fail after merging this?
a421b91
to
2868b21
Compare
You would think, but tests are passing. I do not see anything calling the class method so I'll remove it. |
2868b21
to
2dbbd37
Compare
No description provided.