Skip to content

Conversation

jrafanie
Copy link
Member

No description provided.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 0b71b56 on jrafanie:create_partition_table_if_missing into 9f8d568 on ManageIQ:master.

Copy link
Member

Choose a reason for hiding this comment

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

Prefer String#include? to a Regex when not using anything Regex-y

Copy link
Member

Choose a reason for hiding this comment

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

As per my other note, this could be

def result_indicates_partition_table?(result)
  # parted exits with 1 but writes this oddly spelled error to stdout.
  missing = result.exit_status == 1 && result.output.include?("unrecognised disk label")
  !missing
end

EDIT: or

def result_indicates_partition_table?(result)
  # parted exits with 1 but writes this oddly spelled error to stdout.
  result.exit_status != 1 || !result.output.include?("unrecognised disk label")
end

Copy link
Member Author

Choose a reason for hiding this comment

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

@Fryguy I'll try it out and see what I like.

@jrafanie
Copy link
Member Author

@Fryguy This is ready to go. I removed the negative logic and used include? over the regex.

@movitto This may conflict with the code you are looking at now. My changes are very specific so it should be easy to resolve. Ping me if you need help.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling c38fa31 on jrafanie:create_partition_table_if_missing into 9f8d568 on ManageIQ:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling c38fa31 on jrafanie:create_partition_table_if_missing into 9f8d568 on ManageIQ:master.

Fryguy added a commit that referenced this pull request Aug 22, 2013
Create a missing partition table before creating a partition.
@Fryguy Fryguy merged commit 350b850 into ManageIQ:master Aug 22, 2013
@jrafanie jrafanie deleted the create_partition_table_if_missing branch August 22, 2013 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants