diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..31fd79c --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,6 @@ +[bumpversion] +commit = True +tag = False +current_version = 1.0.1 + +[bumpversion:file:setup.py] diff --git a/.codacy.yml b/.codacy.yml new file mode 100644 index 0000000..e09cd9e --- /dev/null +++ b/.codacy.yml @@ -0,0 +1,8 @@ +--- +exclude_paths: + - '.github/**' + - '.vscode/**' + - 'CHANGELOG.md' + - 'CONTRIBUTING.md' + - 'docs/**' + - 'README.md' diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..498e2ea --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD024": false +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b270f69 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,91 @@ +# phpypam CHANGELOG + +## Unreleased + +--- + +### New + +### Changes + +### Fixes + +### Breaks + +## 1.0.1 - (2021-01-04) + +### New + +* add markdownlint config +* add changelog + +### Fixes + +* fix exception handling for connection errors + +## 1.0.0 + +### New + +* documentation tool chain (#27) +* Merge pull request #28 from cmeissner/contributing\_and\_documentation + +## 0.1.7 + +### Fixes + +* We now should evaluate almost all not found messages and raise the correct Exception. + +## 0.1.6 + +### New + +* handle not found execption for vrf + +## 0.1.5 + +### Fixes + +* return controller paths not names + +### Breakes + +* returns controller paths not names + +## 0.1.4 + +### New + +* some project stuff + +## 0.1.3 + +### Fixes + +* fix typo + +## 0.1.2 + +### New + +* detailed exception handling + +## 0.1.1 + +### Fixes + +* Add exception handling for stupid error reporting of non existing subnets + +## 0.1.0 + +### New + +* First more or less productive release. Feel free to report bugs and issues + +## 0.0.2 + +### Changes + +* add controllers method +* add first simple tests +* extend documentation diff --git a/phpypam/core/api.py b/phpypam/core/api.py index 4e9cac4..68d326b 100644 --- a/phpypam/core/api.py +++ b/phpypam/core/api.py @@ -27,7 +27,9 @@ def __init__(self, url, app_id, username=None, password=None, token=None, encryp The costructor collects all data to connect to phpIPAM API. If all data is there it makes the connection to the given server. - :param url: The URL to a phpIPAM instance. It includes the protocol (`http` or `https`). + :param url: The URL to a phpIPAM instance. It includes the protocol (`https` or `http`). + As phpIPAM does not support `http` and `User token` by default you have to configure phpIPAM to allow unsecure connections. + But be aware on security risk in conjunction with this setting. :type url: str :param app_id: The app_id which is used for the API operations. For modifying operations it needs read/write access. diff --git a/phpypam/core/exceptions.py b/phpypam/core/exceptions.py index cdf0cfe..f94b981 100644 --- a/phpypam/core/exceptions.py +++ b/phpypam/core/exceptions.py @@ -39,7 +39,7 @@ def __init__(self, *args, code=None, message=None): elif self._code == 500: if self._message == 'Invalid username or password': raise PHPyPAMInvalidCredentials(self._message) - elif self._code == 400: + elif self._code == 400 or self._code == 503: raise PHPyPAMInvalidSyntax(message=self._message) # super(PHPyPAMException, self).__init__(*args, **kwargs) diff --git a/requirements-dev.txt b/requirements-dev.txt index cd7420e..31f7732 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,5 @@ wheel +changelog-cli flake8 flake8-colors flake8-docstrings diff --git a/setup.py b/setup.py index 96f5c7d..70e560c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="phpypam", - version="1.0.0", + version="1.0.1", author="Christian Meißner", author_email="Christian Meißner ", description="Python API client library for phpIPAM installation",