def getGuid(create=True, env=GID_ENV): """Return a GUID. If 'create' is True (the default), and if none is found in the environment then create one. """ gid = os.environ.get(env, None) if gid is None: if create: gid = uuid1() return gid