Skip to content

Commit

Permalink
Merge pull request #39 from cmeissner/issue/38
Browse files Browse the repository at this point in the history
increase error handling
  • Loading branch information
cmeissner authored Jan 4, 2021
2 parents b781e6a + e902e1f commit 152c719
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[bumpversion]
commit = True
tag = False
current_version = 1.0.1

[bumpversion:file:setup.py]
8 changes: 8 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
exclude_paths:
- '.github/**'
- '.vscode/**'
- 'CHANGELOG.md'
- 'CONTRIBUTING.md'
- 'docs/**'
- 'README.md'
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD024": false
}
91 changes: 91 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion phpypam/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpypam/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
wheel
changelog-cli
flake8
flake8-colors
flake8-docstrings
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
description="Python API client library for phpIPAM installation",
Expand Down

0 comments on commit 152c719

Please sign in to comment.