Skip to content

Commit

Permalink
fixes issue with undefined attributes as string #47
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Aug 22, 2022
1 parent f07e8d8 commit 0ee7333
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
24 changes: 20 additions & 4 deletions .publi.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
#!/usr/bin/env bash

DOCKERHUB_IMAGE_PATH="bbricardo/fritzinfluxdb"

[[ -z "$1" ]] && echo "please define a version tag" && exit

read -p "Is this a beta (b) release or final (f) release: " -n1 ANSWER && echo

[[ $ANSWER =~ [bB] ]] && FINAL=false
[[ $ANSWER =~ [fF] ]] && FINAL=true
[[ -z "${FINAL+default}" ]] && echo "Please select 'b' or 'f'." && exit 1

unset DOCKER_TLS_VERIFY
unset DOCKER_HOST
unset DOCKER_CERT_PATH

docker --config ./docker-tmp login
docker --config ./docker-tmp buildx create --use
docker --config ./docker-tmp buildx build --push \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--tag bbricardo/fritzinfluxdb:latest \
--tag bbricardo/fritzinfluxdb:${1} .
if [[ $FINAL ]]; then
docker --config ./docker-tmp buildx build --push \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--tag ${DOCKERHUB_IMAGE_PATH}:latest \
--tag ${DOCKERHUB_IMAGE_PATH}:${1} .
[[ $? -ne 0 ]] && exit 1
which docker-pushrm >/dev/null 2>&1 && docker-pushrm ${DOCKERHUB_IMAGE_PATH}:latest
else
docker --config ./docker-tmp buildx build --push \
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
--tag ${DOCKERHUB_IMAGE_PATH}:${1} .
fi

rm -rf ./docker-tmp

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ See this comment for details: https://github.com/bb-Ricardo/fritzinfluxdb/issues
usage: fritzinfluxdb.py [-h] [-c fritzinfluxdb.ini [fritzinfluxdb.ini ...]] [-d] [-v]
fritzinfluxdb
Version: 1.0.1-beta2 (2022-08-21)
Version: 1.0.1 (2022-08-22)
Project URL: https://github.com/bb-Ricardo/fritzinfluxdb
optional arguments:
Expand Down
4 changes: 2 additions & 2 deletions fritzinfluxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
from fritzinfluxdb.classes.fritzbox.handler import FritzBoxHandler, FritzBoxLuaHandler
from fritzinfluxdb.classes.influxdb.handler import InfluxHandler

__version__ = "1.0.1-beta2"
__version_date__ = "2022-08-21"
__version__ = "1.0.1"
__version_date__ = "2022-08-22"
__description__ = "fritzinfluxdb"
__license__ = "MIT"
__url__ = "https://github.com/bb-Ricardo/fritzinfluxdb"
Expand Down
2 changes: 1 addition & 1 deletion fritzinfluxdb/classes/fritzbox/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def extract_value(self, service, data, metric_name, metric_params):
pass

elif data_path is not None:
metric_value = grab(data, data_path)
metric_value = grab(data, data_path, fallback="" if data_path is str else None)

# try to add tags
if isinstance(data_tags, dict):
Expand Down

0 comments on commit 0ee7333

Please sign in to comment.