Skip to content
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

Merged
merged 1 commit into from
Jul 23, 2020
Merged

Conversation

oanatmaria
Copy link
Contributor

No description provided.

@oanatmaria oanatmaria added the enhancement New feature or enhancement label Jul 21, 2020
@oanatmaria oanatmaria requested review from a team July 21, 2020 15:00
@puppetcla
Copy link

CLA signed by all contributors.

class << self
private

MEGABYTES_EXPONENT = 1024**2
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


result.each_line do |line|
disk_name = line.split(' ')[0].strip
info = find_size(disk_name)
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Hash[*lsl_content]
end

def compute_size(info_hash)
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

end

def extract_info(lsl_content)
lsl_content = lsl_content.strip.split("\n").map do |line|
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

spec/facter/resolvers/aix/disks_spec.rb Show resolved Hide resolved
@oanatmaria oanatmaria force-pushed the FACT-2220 branch 2 times, most recently from 3e2cd8b to d2ee78d Compare July 23, 2020 10:42
@oanatmaria
Copy link
Contributor Author

jenkins please test this on aix61-POWERa

@oanatmaria
Copy link
Contributor Author

jenkins please test this on aix61-POWERa

@BogdanIrimie BogdanIrimie merged commit 95112e7 into puppetlabs:4.x Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants