

def add_default_headers(self, headers):
    '\n        Add headers required by the OpenNebula.org OCCI interface.\n\n        Includes adding Basic HTTP Authorization headers for authenticating\n        against the OpenNebula.org OCCI interface.\n\n        :type  headers: ``dict``\n        :param headers: Dictionary containing HTTP headers.\n\n        :rtype:  ``dict``\n        :return: Dictionary containing updated headers.\n        '
    if self.plain_auth:
        passwd = self.key
    else:
        passwd = hashlib.sha1(b(self.key)).hexdigest()
    headers['Authorization'] = ('Basic %s' % b64encode(b(('%s:%s' % (self.user_id, passwd)))).decode('utf-8'))
    return headers

dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py OpenNebulaConnection.add_default_headers/original