Closed nhpackard closed 2 years ago
I thought I had fixed this bug in the past month or so, but maybe it hasn’t been merged, or maybe it’s still there…
Please see if there is a "daptics.conf" configuration file saved in the working directory. Its contents should look something like this:
{
"host": "http://localhost:4040",
"user": "user@domain.com",
"password": "password",
"verify_ssl_certificates": "false"
}
If it doesn't have the "verify_ssl_certificates" ("true" or "false") in it, that could be causing the problem. Also the development branch has this in daptics_client.py
, in the _load_config_file
method. See if your version has it:
for optname in self.DEFAULT_OPTIONS.keys():
optvalue = config.get(optname)
if optvalue is not None:
self.options[optname] = optvalue
print('config_file set option {0} to \'{1}\''.format(optname, optvalue))
currently happens in dev branch of daptics-api repo. (NB: I used 'git revert' to back up main to avoid this problem) FYI, gitlog looks like:
a33384f (HEAD -> dev, origin/dev) added TestAuto.ipynb, gotten from 06_AutomationWorkflow.ipynb
48c5424 (tag: v0.12.0) Merge pull request #30 from ProtoLife/v0.12.0
|\
| 87f2d0d changelog for v0.12.0
| bb55da4 updated documentation
| c421fc8 (origin/v0.12.0) verify_ssl_certificates option, raise exception on failed login
| a6abcfe (v0.12.0) wait on update tasks
| 1a64a8f updated for api server 0.12.0
| 7b9b49f copyright 2021
|/
33f0d09 moved LICENSE file into package
Notebook just pushed is TestAuto.ipynb. clone of 06_AutomationWorkflow.ipynb, which I am having trouble opening (cf. issue #40). This notebook has worked in the recent past.
no daptics.conf file in working dir (which is .../daptics-api/python_client/). (who/what is responsible for putting it there?)
I have different _load_config_file: your snippet looks like
for optname in self.options.keys():
self.options[optname] = config.get(optname, self.options[optname])
whole function is:
def _load_config_file(self, config_path, config_must_exist):
if os.path.exists(config_path):
try:
with open(config_path) as f:
config = json.load(f)
self.config = config_path
if self.host is None:
self.host = config.get('host')
if self.credentials is None:
username = config.get('user')
password = config.get('password')
if username and password:
self.credentials = (username, password)
for optname in self.options.keys():
self.options[optname] = config.get(optname, self.options[optname])
return True
except:
raise InvalidConfigError(config_path)
elif config_must_exist:
raise MissingConfigError(config_path)
return False
git tells me last time daptics_client.py was changed (in dev branch) was
commit c421fc8382729c518aeab9390ad69041d4e96809 (origin/v0.12.0)
maybe your _load_config_file() version is in another branch?
Fixed by recent work on rservex.
in both dev and main branches,
daptics.connect()
yields: