projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
debian: Add missing ${python:Depends} to openvswitch-test package.
[openvswitch]
/
python
/
ovs
/
ovsuuid.py
diff --git
a/python/ovs/ovsuuid.py
b/python/ovs/ovsuuid.py
index df4f1fd769644127513e1060ad226a1c8bb19917..31c9bccd571abab8bc01748b30e2400e2856e72c 100644
(file)
--- a/
python/ovs/ovsuuid.py
+++ b/
python/ovs/ovsuuid.py
@@
-21,6
+21,7
@@
import ovs.db.parser
uuidRE = re.compile("^xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx$"
.replace('x', '[0-9a-fA-F]'))
uuidRE = re.compile("^xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx$"
.replace('x', '[0-9a-fA-F]'))
+
def zero():
return uuid.UUID(int=0)
def zero():
return uuid.UUID(int=0)
@@
-37,7
+38,7
@@
def from_string(s):
def from_json(json, symtab=None):
try:
def from_json(json, symtab=None):
try:
- s = ovs.db.parser.unwrap_json(json, "uuid",
unicode
)
+ s = ovs.db.parser.unwrap_json(json, "uuid",
[str, unicode], "string"
)
if not uuidRE.match(s):
raise error.Error("\"%s\" is not a valid UUID" % s, json)
return uuid.UUID(s)
if not uuidRE.match(s):
raise error.Error("\"%s\" is not a valid UUID" % s, json)
return uuid.UUID(s)
@@
-45,12
+46,13
@@
def from_json(json, symtab=None):
if not symtab:
raise e
try:
if not symtab:
raise e
try:
- name = ovs.db.parser.unwrap_json(json, "named-uuid", unicode)
+ name = ovs.db.parser.unwrap_json(json, "named-uuid",
+ [str, unicode], "string")
except error.Error:
raise e
if name not in symtab:
except error.Error:
raise e
if name not in symtab:
- symtab[name] = uuid4()
+ symtab[name] = uuid
.uuid
4()
return symtab[name]
return symtab[name]