From 64d16b0d56277ab85928f556df13c8b7580533ab Mon Sep 17 00:00:00 2001 From: Seblu <sebastien.luttringer@smartjog.com> Date: Mon, 29 Aug 2011 15:37:47 +0200 Subject: [PATCH] image name can use - and _ --- bin/is | 2 +- installsystems/image.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/is b/bin/is index 9e9b166..0fd362c 100755 --- a/bin/is +++ b/bin/is @@ -54,7 +54,7 @@ def select_image(name, repoman, best=False): if istools.isfile(name) and os.path.isfile(name): return PackageImage(name), None else: - x = re.match("^((\w+)/)?(\w+)(:v?(\d+))?$", name) + x = re.match("^(([-_\w]+)/)?([-_\w]+)(:v?(\d+))?$", name) if x is None: raise Exception("%s is not a valid image" % name) (repo, image, version) = x.group(2,3,5) diff --git a/installsystems/image.py b/installsystems/image.py index 0a97220..e753f4a 100644 --- a/installsystems/image.py +++ b/installsystems/image.py @@ -37,7 +37,7 @@ class Image(object): ''' Check if @name is a valid image name ''' - return re.match("\w+", buf) is not None + return re.match("[-_\w]+", buf) is not None @staticmethod def check_image_version(buf): -- GitLab