# Path: katprep/management/base.py
# class BaseConnector(metaclass=ABCMeta):
#     """
#     Basic management connector that connects on creation.
#     """
# 
#     def __init__(self, username, password, **kwargs):
#         self._username = username
#         self._password = password
#         self._session = None
#         self._connect()
# 
#     @abstractmethod
#     def _connect(self):
#         pass
# 
# Path: katprep/exceptions.py
# class APILevelNotSupportedException(Exception):
#     """
#     Dummy class for unsupported API levels
# 
#     .. class:: APILevelNotSupportedException
#     """
# 
# class InvalidCredentialsException(Exception):
#     """
#     Dummy class for invalid credentials
# 
#     .. class:: InvalidCredentialsException
#     """
# 
# class SessionException(Exception):
#     """
#     Dummy class for session errors
# 
#     .. class:: SessionException
#     """


import logging
import json
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from .base import BaseConnector
from ..exceptions import (APILevelNotSupportedException,
InvalidCredentialsException, SessionException)
                my_headers["Content-Type"] = "application/json"
                my_headers["Accept"] = "application/json,version=2"

            #send request
            if method.lower() == "put":
                #PUT
                result = self._session.put(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            elif method.lower() == "delete":
                #DELETE
                result = self._session.delete(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            elif method.lower() == "post":
                #POST
                result = self._session.post(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            else:
                #GET
                result = self._session.get(
                    "{}{}?per_page={}&page={}".format(
                        self.URL, sub_url, hits, page),
                    headers=self.HEADERS, verify=self.VERIFY
                )
            if "unable to authenticate" in result.text.lower():

# Path: katprep/management/base.py
# class BaseConnector(metaclass=ABCMeta):
#     """
#     Basic management connector that connects on creation.
#     """
# 
#     def __init__(self, username, password, **kwargs):
#         self._username = username
#         self._password = password
#         self._session = None
#         self._connect()
# 
#     @abstractmethod
#     def _connect(self):
#         pass
# 
# Path: katprep/exceptions.py
# class APILevelNotSupportedException(Exception):
#     """
#     Dummy class for unsupported API levels
# 
#     .. class:: APILevelNotSupportedException
#     """
# 
# class InvalidCredentialsException(Exception):
#     """
#     Dummy class for invalid credentials
# 
#     .. class:: InvalidCredentialsException
#     """
# 
# class SessionException(Exception):
#     """
#     Dummy class for session errors
# 
#     .. class:: SessionException
#     """


# Path: katprep/management/foreman.py
import logging
import json
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from .base import BaseConnector
from ..exceptions import (APILevelNotSupportedException,
InvalidCredentialsException, SessionException)

                my_headers["Content-Type"] = "application/json"
                my_headers["Accept"] = "application/json,version=2"

            #send request
            if method.lower() == "put":
                #PUT
                result = self._session.put(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            elif method.lower() == "delete":
                #DELETE
                result = self._session.delete(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            elif method.lower() == "post":
                #POST
                result = self._session.post(
                    "{}{}".format(self.URL, sub_url),
                    data=payload, headers=my_headers, verify=self.VERIFY
                )
            else:
                #GET
                result = self._session.get(
                    "{}{}?per_page={}&page={}".format(
                        self.URL, sub_url, hits, page),
                    headers=self.HEADERS, verify=self.VERIFY
                )
            if "unable to authenticate" in result.text.lower():

                raise InvalidCredentialsException("Unable to authenticate")