Skip to content

Commit

Permalink
Ignore blank likes in host_list file (#761)
Browse files Browse the repository at this point in the history
* Added a blank line

* Ignore blank lines in host_list file

* Ignore blank lines in host_list file
  • Loading branch information
VenkataNaladala94 authored Jun 17, 2024
1 parent 6a56e53 commit 405fa66
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion medusa/restore_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def _populate_hostmap(self):
# Remove leading/trailing whitespace
_line = line.strip()
# Ignore comment lines
if _line.startswith('#'):
if not _line or _line.startswith('#'):
continue
seed, target, source = _line.split(self.config.storage.host_file_separator)
# in python, bool('False') evaluates to True. Need to test the membership as below
Expand Down
4 changes: 3 additions & 1 deletion tests/resources/restore_cluster_host_list.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#Adding the comment and a blank line below. This should not cause an error while parsing this file.

True,node1.mydomain.net,node1.mydomain.net
True,node2.mydomain.net,node2.mydomain.net
False,node3.mydomain.net,node4.mydomain.net
False,node3.mydomain.net,node4.mydomain.net

0 comments on commit 405fa66

Please sign in to comment.