def setup_ndr_client_config(self):
logging.getLogger().addHandler(logging.NullHandler())
self._ncc = ndr.Config(NDR_CONFIG_FILE)
self._ncc.logger = logging.getLogger()
self._ncc.image_information_file = IMAGE_CONFIG
self._created_files = []
config_ndr_for_signing_and_local_queue(self)
# Create a temporary directory for handling config files that are optional but may get
# written out or updated or something.
self._ncc_config_dir = tempfile.mkdtemp()
# Override optional config files with paths that won't conflict
self._ncc.nmap_configuration_file = self._ncc_config_dir + "/nmap_config.yml"
# Write out the test config for testing mainrun programs
self._ndr_config_file = create_temp_file(self)
with open(self._ndr_config_file, 'w') as f:
yaml_content = yaml.dump(self._ncc.to_dict())
f.write(yaml_content)
评论列表
文章目录