Skip to content

Commit 152c719

Browse files
authored
Merge pull request #39 from cmeissner/issue/38
increase error handling
2 parents b781e6a + e902e1f commit 152c719

8 files changed

+115
-3
lines changed

.bumpversion.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[bumpversion]
2+
commit = True
3+
tag = False
4+
current_version = 1.0.1
5+
6+
[bumpversion:file:setup.py]

.codacy.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
exclude_paths:
3+
- '.github/**'
4+
- '.vscode/**'
5+
- 'CHANGELOG.md'
6+
- 'CONTRIBUTING.md'
7+
- 'docs/**'
8+
- 'README.md'

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD024": false
4+
}

CHANGELOG.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# phpypam CHANGELOG
2+
3+
## Unreleased
4+
5+
---
6+
7+
### New
8+
9+
### Changes
10+
11+
### Fixes
12+
13+
### Breaks
14+
15+
## 1.0.1 - (2021-01-04)
16+
17+
### New
18+
19+
* add markdownlint config
20+
* add changelog
21+
22+
### Fixes
23+
24+
* fix exception handling for connection errors
25+
26+
## 1.0.0
27+
28+
### New
29+
30+
* documentation tool chain (#27)
31+
* Merge pull request #28 from cmeissner/contributing\_and\_documentation
32+
33+
## 0.1.7
34+
35+
### Fixes
36+
37+
* We now should evaluate almost all not found messages and raise the correct Exception.
38+
39+
## 0.1.6
40+
41+
### New
42+
43+
* handle not found execption for vrf
44+
45+
## 0.1.5
46+
47+
### Fixes
48+
49+
* return controller paths not names
50+
51+
### Breakes
52+
53+
* returns controller paths not names
54+
55+
## 0.1.4
56+
57+
### New
58+
59+
* some project stuff
60+
61+
## 0.1.3
62+
63+
### Fixes
64+
65+
* fix typo
66+
67+
## 0.1.2
68+
69+
### New
70+
71+
* detailed exception handling
72+
73+
## 0.1.1
74+
75+
### Fixes
76+
77+
* Add exception handling for stupid error reporting of non existing subnets
78+
79+
## 0.1.0
80+
81+
### New
82+
83+
* First more or less productive release. Feel free to report bugs and issues
84+
85+
## 0.0.2
86+
87+
### Changes
88+
89+
* add controllers method
90+
* add first simple tests
91+
* extend documentation

phpypam/core/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def __init__(self, url, app_id, username=None, password=None, token=None, encryp
2727
2828
The costructor collects all data to connect to phpIPAM API. If all data is there it makes the connection to the given server.
2929
30-
:param url: The URL to a phpIPAM instance. It includes the protocol (`http` or `https`).
30+
:param url: The URL to a phpIPAM instance. It includes the protocol (`https` or `http`).
31+
As phpIPAM does not support `http` and `User token` by default you have to configure phpIPAM to allow unsecure connections.
32+
But be aware on security risk in conjunction with this setting.
3133
:type url: str
3234
:param app_id: The app_id which is used for the API operations.
3335
For modifying operations it needs read/write access.

phpypam/core/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, *args, code=None, message=None):
3939
elif self._code == 500:
4040
if self._message == 'Invalid username or password':
4141
raise PHPyPAMInvalidCredentials(self._message)
42-
elif self._code == 400:
42+
elif self._code == 400 or self._code == 503:
4343
raise PHPyPAMInvalidSyntax(message=self._message)
4444

4545
# super(PHPyPAMException, self).__init__(*args, **kwargs)

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
wheel
2+
changelog-cli
23
flake8
34
flake8-colors
45
flake8-docstrings

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="phpypam",
8-
version="1.0.0",
8+
version="1.0.1",
99
author="Christian Meißner",
1010
author_email="Christian Meißner <[email protected]>",
1111
description="Python API client library for phpIPAM installation",

0 commit comments

Comments
 (0)