Skip to content

Commit

Permalink
Fixes #16336: Custom methods don't appear in technique editor anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceMacBuche committed Dec 4, 2019
1 parent a059313 commit 1afcef6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tools/ncf.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def get_all_generic_methods_filenames(alt_path=None):
result = []
if alt_path is None:
filelist1 = get_all_generic_methods_filenames_in_dir(get_root_dir() + "/tree/30_generic_methods")
filelist2 = get_all_generic_methods_filenames_in_dir("/var/rudder/configuration-repository/30_generic_methods")
filelist2 = get_all_generic_methods_filenames_in_dir("/var/rudder/configuration-repository/ncf/30_generic_methods")
result = filelist1 + filelist2
else:
result = get_all_generic_methods_filenames_in_dir(alt_path)
Expand All @@ -114,15 +114,18 @@ def get_all_techniques_filenames(migrate_technique = False):
else:
path = os.path.join(basePath,"techniques/ncf_techniques")

return get_all_cf_filenames_under_dir(path, not migrate_technique)
return get_all_cf_filenames_under_dir(path, not migrate_tehnique)


def get_all_cf_filenames_under_dir(dir, only_technique_cf):
def get_all_cf_filenames_under_dir(parent_dir, only_technique_cf):
filenames = []
filenames_add = filenames.append
for root, dirs, files in os.walk(dir):
for root, dirs, files in os.walk(parent_dir):
for dir in dirs:
filenames = filenames + get_all_cf_filenames_under_dir(os.path.join(parent_dir,dir),only_technique_cf)

for file in files:
if only_technique_cf:
if only_technique_cf:
if file == "technique.cf":
filenames_add(os.path.join(root, file))
elif not file.startswith("_") and file.endswith(".cf"):
Expand Down

0 comments on commit 1afcef6

Please sign in to comment.