commit message from python script
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def read_sshkeys(target_folder = str, search_string = str):
|
def read_all_sub_Folder(target_folder = str, search_string = str):
|
||||||
key_liste = []
|
key_liste = []
|
||||||
for root, dirs, files in os.walk(target_folder, topdown=False, ):
|
for root, dirs, files in os.walk(target_folder, topdown=False, ):
|
||||||
for name in files:
|
for name in files:
|
||||||
@@ -19,10 +19,16 @@ def read_sshkeys(target_folder = str, search_string = str):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
search_jenkins_folder = "/home/jonnybravo/.jenkins/data/jobs"
|
search_jenkins_folder = "/home/jonnybravo/.jenkins/data/jobs"
|
||||||
for i in read_sshkeys(target_folder=search_jenkins_folder, search_string="config.xml"):
|
search_string = """<command>./test_play.yml</command>"""
|
||||||
print(i["FullPath"])
|
for i in read_all_sub_Folder(target_folder=search_jenkins_folder, search_string="config.xml"):
|
||||||
|
#print(i["FullPath"])
|
||||||
with open(i["FullPath"], 'r') as file:
|
with open(i["FullPath"], 'r') as file:
|
||||||
data = file.read()
|
data = file.read()
|
||||||
data = data.replace('<daysToKeep>-1</daysToKeep>', '')
|
index = data.find(search_string)
|
||||||
with open(i["FullPath"], 'w') as file:
|
print(index)
|
||||||
file.write(data)
|
if not index == -1:
|
||||||
|
print("Ist in file vorhanden", file, sep=" ")
|
||||||
|
|
||||||
|
#data = data.replace('<daysToKeep>-1</daysToKeep>', '')
|
||||||
|
#with open(i["FullPath"], 'w') as file:
|
||||||
|
# file.write(data)
|
||||||
Reference in New Issue
Block a user