Tagging fixes

This commit is contained in:
Lauri Võsandi 2017-04-13 15:42:38 +00:00
parent 7a7f22c1a1
commit d91e12942d
2 changed files with 6 additions and 2 deletions

View File

@ -56,7 +56,10 @@ class TagDetailResource(object):
tags = set(getxattr(path, "user.xdg.tags").decode("utf-8").split(","))
except IOError:
tags = set()
tags.remove(tag)
try:
tags.remove(tag)
except KeyError:
pass
if "=" in tag:
tags.add("%s=%s" % (tag.split("=")[0], value))
else:

View File

@ -123,6 +123,7 @@ def revoke(common_name):
attachments=(attach_cert,),
serial_number="%x" % cert.serial,
common_name=common_name)
return revoked_path
def server_flags(cn):
if config.USER_ENROLLMENT_ALLOWED and not config.USER_MULTIPLE_CERTIFICATES:
@ -317,7 +318,7 @@ def _sign(csr, buf, overwrite=False):
revoked_path = os.path.join(config.REVOKED_DIR, "%x.pem" % prev.serial)
os.rename(signed_path, revoked_path)
else:
revoke(common_name.value)
revoked_path = revoke(common_name.value)
else:
raise EnvironmentError("Will not overwrite existing certificate")