-
Notifications
You must be signed in to change notification settings - Fork 494
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
(FACT-2220) Add Aix disks fact #1987
Conversation
CLA signed by all contributors. |
lib/facter/resolvers/aix/disks.rb
Outdated
class << self | ||
private | ||
|
||
MEGABYTES_EXPONENT = 1024**2 |
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.
These should be extracted in a common util class, as it it already defined in aix/disks.rb
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.
Done
lib/facter/resolvers/aix/disks.rb
Outdated
|
||
result.each_line do |line| | ||
disk_name = line.split(' ')[0].strip | ||
info = find_size(disk_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.
Could you please rename info to size or size_hash?
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.
Done
lib/facter/resolvers/aix/disks.rb
Outdated
Hash[*lsl_content] | ||
end | ||
|
||
def compute_size(info_hash) |
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.
This is pretty similar to the one implemented in aix/utils/partitions.rb maybe it could be reused.
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.
Done
lib/facter/resolvers/aix/disks.rb
Outdated
end | ||
|
||
def extract_info(lsl_content) | ||
lsl_content = lsl_content.strip.split("\n").map do |line| |
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.
Will strip.split("\n") work properly? str.strip will also remove "\n"
Maybe you could replace it with .each_line
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.
Done
3e2cd8b
to
d2ee78d
Compare
jenkins please test this on aix61-POWERa |
jenkins please test this on aix61-POWERa |
No description provided.