mirror of https://github.com/apache/cloudstack.git
init and sign
This commit is contained in:
parent
6819c237c0
commit
f0e99fff8a
|
|
@ -147,8 +147,10 @@ class CSConnection(object):
|
|||
).replace("+", "%20")]
|
||||
) for r in params]
|
||||
)
|
||||
signature = base64.encodestring(hmac.new(
|
||||
self.securityKey, hash_str, hashlib.sha1).digest()).strip()
|
||||
signature = base64.encodestring(
|
||||
hmac.new(self.securityKey.encode('utf-8'),
|
||||
hash_str.encode('utf-8'),
|
||||
hashlib.sha1).digest()).strip()
|
||||
return signature
|
||||
|
||||
def __sendPostReqToCS(self, url, payload):
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class MarvinLog:
|
|||
|
||||
def __new__(cls, logger_name):
|
||||
if not cls._instance:
|
||||
cls._instance = super(MarvinLog, cls).__new__(cls, logger_name)
|
||||
cls._instance = super(MarvinLog, cls).__new__(cls)
|
||||
return cls._instance
|
||||
|
||||
def __init__(self, logger_name):
|
||||
|
|
|
|||
Loading…
Reference in New Issue