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

Cannot add a new volume if the volume group has the same name. Fix: Better regexp for parsing the output of lvs #173

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

ruriky
Copy link
Contributor

@ruriky ruriky commented Dec 9, 2016

There is a bug which prevents user from adding a new logical volume if the volume name is the same as the volume group's name.

The regexp which parses the output of lvs command searches only for the name of the new logical volume. If the output contains previously added logical volumes, the regexp will match with the volume group's name of those volumes. Because the logical volume does not actually exist yet, the proceeding function which tries to extract the size of the new volume will fail.

This fix extends the regexp to match not only with the logical volume name put with the combination of logical volume name and the volume group name.

Example output of lvs command:

  LV   VG   Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  comp data -wi-ao---- 5.00g
  root data -wi-ao---- 5.00g
  swap data -wi-ao---- 4.00g

Example of failing conf:

---
lvm::volume_groups:
  data:
    physical_volumes:
      - /dev/sda2
      - /dev/sda3
    logical_volumes:
      comp:
        size: 5G   
      data:
        size: 5G
      root:
        size: 5G

Fix the problem where user cannot add a new logical volume which has the
same name as the volume group where the volume is being created to.
@bmjen bmjen merged commit 2383d59 into puppetlabs:master Jan 12, 2017
@bmjen
Copy link
Contributor

bmjen commented Jan 12, 2017

Thanks @ruriky !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants