Skip to content

Commit

Permalink
restrict version regex to maj.min.patch version
Browse files Browse the repository at this point in the history
Current regex breaks on libguestfs 1.32.7 from CentOS 7 Continuous
Release repo given that they compile it with:

$ ./configure --with-extra='rhel=7,release=3.el7.centos,libvirt'

Which produces:

$ yum-config-manager --enable cr
$ yum clean all && yum install libguestfs{,-tools}
$ virt-customize --version
virt-customize 1.32.7rhel=7,release=3.el7.centos,libvirt
  • Loading branch information
jtriley committed Dec 9, 2016
1 parent d43dbe9 commit 0272e19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cangallo/libguestfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def self.virt_sparsify(image)
def self.version
str = `virt-customize --version`

m = str.match(/^virt-customize (.*)$/)
m = str.match(/^virt-customize (\d+\.\d+\.\d+).*$/)

if m
m[1]
Expand Down

0 comments on commit 0272e19

Please sign in to comment.