Fix import of version

If the import fails it wipes out the global pylorax import.
This commit is contained in:
Brian C. Lane 2013-04-03 16:28:22 -07:00
parent 52070f045c
commit 12bad32223

View File

@ -78,11 +78,10 @@ def setup_logging(opts):
def main(args): def main(args):
# get lorax version # get lorax version
try: try:
import pylorax.version from pylorax import version
vernum = version.num
except ImportError: except ImportError:
vernum = "devel" vernum = "devel"
else:
vernum = pylorax.version.num
version = "{0}-{1}".format(os.path.basename(args[0]), vernum) version = "{0}-{1}".format(os.path.basename(args[0]), vernum)
usage = "%prog -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR" usage = "%prog -p PRODUCT -v VERSION -r RELEASE -s REPOSITORY OUTPUTDIR"