need to support python2.4, so can't use uuid module
This commit is contained in:
parent
cf89dea62e
commit
b39a0eabd5
@ -23,6 +23,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import commands
|
||||||
try:
|
try:
|
||||||
import json
|
import json
|
||||||
except ImportError:
|
except ImportError:
|
||||||
@ -32,7 +33,6 @@ import random
|
|||||||
import subprocess
|
import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
import uuid
|
|
||||||
|
|
||||||
import XenAPIPlugin
|
import XenAPIPlugin
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ def _agent_has_method(self, method):
|
|||||||
self._agent_methods = []
|
self._agent_methods = []
|
||||||
if not self._agent_methods:
|
if not self._agent_methods:
|
||||||
# Haven't been defined
|
# Haven't been defined
|
||||||
tmp_id = str(uuid.uuid4())
|
tmp_id = commands.getoutput("uuidgen")
|
||||||
dct = {}
|
dct = {}
|
||||||
dct["value"] = json.dumps({"name": "features", "value": ""})
|
dct["value"] = json.dumps({"name": "features", "value": ""})
|
||||||
dct["path"] = "data/host/%s" % tmp_id
|
dct["path"] = "data/host/%s" % tmp_id
|
||||||
|
Loading…
Reference in New Issue
Block a user