Skip to content

(FACT-2220) Add Aix disks fact#1987

Merged
BogdanIrimie merged 1 commit intopuppetlabs:4.xfrom
oanatmaria:FACT-2220
Jul 23, 2020
Merged

(FACT-2220) Add Aix disks fact#1987
BogdanIrimie merged 1 commit intopuppetlabs:4.xfrom
oanatmaria:FACT-2220

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

@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