Skip to content

Commit

Permalink
Fix default port assignment from config file
Browse files Browse the repository at this point in the history
Resolves #94
  • Loading branch information
durera committed Feb 2, 2018
1 parent 356435f commit 5d4a53c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='ibmiotf',
version="0.3.2",
version="0.3.3",
author='David Parker',
author_email='[email protected]',
package_dir={'': 'src'},
Expand Down
2 changes: 1 addition & 1 deletion src/ibmiotf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from datetime import datetime
from encodings.base64_codec import base64_encode

__version__ = "0.3.2"
__version__ = "0.3.3"

class Message:
def __init__(self, data, timestamp=None):
Expand Down
2 changes: 1 addition & 1 deletion src/ibmiotf/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def ParseConfigFile(configFilePath):
parms = configparser.ConfigParser({
"id": str(uuid.uuid4()),
"domain": "internetofthings.ibmcloud.com",
"port": 8883,
"port": "8883", # Even though this is a string here, the parms.getint method will ensure it's assigned as an int
"type": "standalone",
"clean-session": "true"
})
Expand Down
4 changes: 2 additions & 2 deletions src/ibmiotf/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ def __onDMEActionRequest(self,client,userdata,pahoMessage):
def ParseConfigFile(configFilePath):
parms = configparser.ConfigParser({
"domain": "internetofthings.ibmcloud.com",
"port": 8883,
"port": "8883", # Even though this is a string here, the parms.getint method will ensure it's assigned as an int
"clean-session": "true"
})
sectionHeader = "device"
Expand All @@ -927,7 +927,7 @@ def ParseConfigFile(configFilePath):
authToken = parms.get(sectionHeader, "auth-token")
cleanSession = parms.get(sectionHeader, "clean-session")
port = parms.getint(sectionHeader, "port")

except IOError as e:
reason = "Error reading device configuration file '%s' (%s)" % (configFilePath,e[1])
raise ConfigurationException(reason)
Expand Down
2 changes: 1 addition & 1 deletion src/ibmiotf/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def __onDeviceMgmtResponse(self, client, userdata, pahoMessage):
def ParseConfigFile(configFilePath):
parms = configparser.ConfigParser({
"domain": "internetofthings.ibmcloud.com",
"port": 8883,
"port": "8883", # Even though this is a string here, the parms.getint method will ensure it's assigned as an int
"clean-session": "true"
})
sectionHeader = "device"
Expand Down

0 comments on commit 5d4a53c

Please sign in to comment.