def add_default_headers(self, headers):
        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
Add headers required by the OpenNebula.org OCCI interface.
dataset/ETHPy150Open apache/libcloud/libcloud/compute/drivers/opennebula.py/OpenNebulaConnection.add_default_headers