Skip to content

Commit 876cd65

Browse files
authored
fix #51 - wrong Exception on search on empty subnet (#56)
* Fix #51 - When searching for addresses in an empty subnet * extend script to setup local test env to use `podman` if available * add make target to setup local phpipam test env with one command
1 parent 0adfb72 commit 876cd65

File tree

5 files changed

+345
-65
lines changed

5 files changed

+345
-65
lines changed

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44

55
### New
66

7+
* add make target for setting up local test environment
8+
9+
Add target ```setup-phpipam``` to setup a local test environment on an easy way.
10+
711
### Changes
8-
* Switch sphinx from recommonmark to myst_parser
912

13+
* Switch sphinx from recommonmark to myst_parser
1014
* remove duplicated code from test cases
15+
* Add ability to use ```podman``` if available on your system to spin up local test environment.
1116

1217
### Fixes
1318

19+
* \#51 - Subnet address search with zero results raises incorrect exception
20+
21+
When searching for addresses in an empty subnet, ```PHPEntityNotFoundException``` will be raised.
22+
1423
### Breaks
1524

1625
## 1.0.2 - (2021-09-02)

Makefile

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ clean:
5151
find . -name '*~' -exec rm -f {} +
5252
find . -name '__pycache__' -exec rm -rf {} +
5353
coverage erase
54+
docker-compose -f tests/docker/docker-compose.yml stop
55+
docker-compose -f tests/docker/docker-compose.yml rm -f
5456

5557
doc-setup:
5658
pip install --upgrade -r docs/requirements.txt
@@ -78,6 +80,11 @@ coverage: test-all
7880
coverage-xml: test-all
7981
coverage xml --include 'phpypam/*','phpypam/**/*','tests/**/*'
8082

83+
setup-phpipam: test-setup
84+
docker-compose -f tests/docker/docker-compose.yml up -d
85+
sleep 30
86+
sh tests/docker/setup_database.sh
87+
8188
FORCE:
8289

8390
.PHONY: help dist lint publish FORCE

phpypam/core/exceptions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class PHPyPAMException(Exception):
1515
'No devices configured',
1616
'No results (filter applied)',
1717
'No objects found',
18-
'Hostname not found'
18+
'Hostname not found',
19+
'No addresses found'
1920
}
2021

2122
def __init__(self, *args, code=None, message=None):

0 commit comments

Comments
 (0)