Skip to content

Commit

Permalink
Fix dhcp tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Dec 13, 2024
1 parent 22d9fa3 commit 712124a
Show file tree
Hide file tree
Showing 7 changed files with 587 additions and 13 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,6 @@ jobs:
run: |
pip3 install -r "${GITHUB_WORKSPACE}/requirements/test.txt"
- name: Install PostgreSQL driver
if: ${{ matrix.db-engine == 'psql' }}
run: pip3 install psycopg2-binary

- name: Test ralph_dchp_agent using python-${{ matrix.python-version }}
run: python contrib/dhcp_agent/test.py

Expand Down
11 changes: 6 additions & 5 deletions contrib/dhcp_agent/dhcp_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
from logging import handlers as logging_handlers
from optparse import OptionParser

IS_PY3 = sys.version_info[0] == 3
if IS_PY3:
try:
from dbm import gnu as cache_db
except: # noqa
import dbm as cache_db

try:
from urllib.error import HTTPError
from urllib.parse import urlencode
from urllib.request import Request, urlopen
string_types = (str,)
else:
import dbm as cache_db
except: # noqa
from urllib import urlencode

from urllib2 import HTTPError, Request, urlopen
string_types = (basestring,)

Expand Down
Empty file.
Loading

0 comments on commit 712124a

Please sign in to comment.