imperva / imperva/incapsula-cli

Error restoring full config

Open
#11 12 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
33
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Hi, I am getting an error when trying to restore the whole config for a domain or all domains:

[alex@localhost python3.9]$ incap site restore --domain=DOMAIN_NAME /home/alex/imperva/backup/CONF_FILE.json
Traceback (most recent call last):
File "/home/alex/.local/bin/incap", line 8, in
sys.exit(main())
File "/home/alex/.local/lib/python3.9/site-packages/cwafcli/__main__.py", line 9, in main
sys.exit(clidriver.main(sys.argv[1:]))
File "/home/alex/.local/lib/python3.9/site-packages/cwafcli/Utils/clidriver.py", line 896, in main
args.func(args)
File "/home/alex/.local/lib/python3.9/site-packages/cwafcli/Utils/cSite_restore.py", line 22, in c_site_restore
config = IncapConfigurations()
File "/home/alex/.local/lib/python3.9/site-packages/cwafcli/Config/configuration.py", line 10, in __init__
config[profile] = {'id': api_id,
File "/usr/local/lib/python3.9/configparser.py", line 974, in __setitem__
self.read_dict({key: value})
File "/usr/local/lib/python3.9/configparser.py", line 754, in read_dict
self.set(section, key, value)
File "/usr/local/lib/python3.9/configparser.py", line 1200, in set
self._validate_value_types(option=option, value=value)
File "/usr/local/lib/python3.9/configparser.py", line 1185, in _validate_value_types
raise TypeError("option values must be strings")
TypeError: option values must be strings

Any idea?

Contributor guide

Open the contributing guide

Research direction

Start with cwafcli/Config/configuration.py, where IncapConfigurations builds the ConfigParser values, then inspect cwafcli/Utils/cSite_restore.py and reproduce the whole-config restore command. Done means the restore no longer raises ConfigParser's option-values TypeError for a domain or all domains.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.