Skip to content
Snippets Groups Projects
Commit 90be042f authored by karamchandan's avatar karamchandan
Browse files

Merge branch 'feat/l3-components' of https://labs.etsi.org/rep/tfs/controller...

Merge branch 'feat/l3-components' of https://labs.etsi.org/rep/tfs/controller into feat/l3-components
parents 8e04db4e 768960f6
No related branches found
No related tags found
2 merge requests!142Release TeraFlowSDN 2.1,!141Pre-release fixes and code cleanup in L3 cybersecurity components
......@@ -146,9 +146,9 @@ class l3_distributedattackdetector:
# Log a message indicating that the program is stopping gracefully
LOGGER.info("Gracefully stopping...")
def follow(self, file, time_sleep):
def follow(self, logfile, time_sleep):
"""
Generator function that yields new lines in a file.
Generator function that yields new lines in a log file.
This method reads a file object and yields new lines as they are added to the file. The method uses an infinite loop to continuously read the last line of the file. If the file hasn't been updated, the method sleeps for the specified `time_sleep` interval. If the last line of the file doesn't end with a newline character, the method appends the line to a `chunk` variable. When a newline character is encountered, the method yields the line, possibly appending the `chunk` variable to the line if it contains a partial line. The method returns an iterator that yields lines from the file.
......@@ -164,14 +164,14 @@ class l3_distributedattackdetector:
"""
# seek the end of the file
# file.seek(0, os.SEEK_END)
# logfile.seek(0, os.SEEK_END)
chunk = ""
# start an infinite loop
while True:
# read last line of the file
line = file.readline()
line = logfile.readline()
# sleep if the file hasn't been updated
if not line:
......
......@@ -14,7 +14,7 @@
# limitations under the License.
source src/tests/scenario3/l3/deploy_specs.sh
deploy/all.sh
./deploy/all.sh
source tfs_runtime_env_vars.sh
ofc22/run_test_01_bootstrap.sh
ofc22/run_test_02_create_service.sh
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment