Yes, and I agree this change was confusing and not well documented. See
here on the "funct_" append change.
Your options, to my knowledge, are:
1. Delete the created "funct_" files and rename the old ones by appending the new "funct_" naming convention.
2. Delete the created files and do not rename the old ones (nothing actually references those file names anymore, setup.py used to).
Note that option #2 above may cause an issue if you have the 'old-school' setup.py file.
Here is what they used to look like, and
here is a newer one for reference.
Modify the package's setup.py (recommended) to include:
from setuptools import setup, find_packages
import glob
import ntpath
def get_module_name(module_path):
"""
Return the module name of the module path
"""
return ntpath.split(module_path)[1].split(".")[0]
def snake_to_camel(word):
"""
Convert a word from snake_case to CamelCase
"""
return ''.join(x.capitalize() or '_' for x in word.split('_'))
# ... Then, inside the setup object change the entry_points's resilient.circuits.components key , removing the hard-coded function component names, like:
entry_points={
"resilient.circuits.components": [
# When setup.py is executed, loop through the .py files in the components directory and create the entry points.
"{}FunctionComponent = tenable_sc.components.{}:FunctionComponent".format(snake_to_camel(get_module_name(filename)), get_module_name(filename)) for filename in glob.glob("./tenable_sc/components/[a-zA-Z]*.py")
],
Additionally, instead of doing --reload with codegen, consider doing this:
cd /home/path-to-resilient-function-packages-directory-here/
resilient-circuits codegen --package package_name --function new_function_api_name
sudo python -m pip install --editable /home/path-to-resilient-function-packages-directory-here/package_name
The --reload method you used must be new(er), and to be honest I don't understand its purpose, since you don't need it to add to packages.
------------------------------
Jared Fagel
Cyber Security Analyst Intern
Public Utility
------------------------------