phunehehe/check-amanda — pull request #1 by nhannguyen (2014-04-15 09:45:57+00:00)
Title: Fix checking empty directory

Fix error like
```
Checking daily backup of tbbc-prod1:/var ...
Traceback (most recent call last):
File "/home/phunehehe/check-amanda/check-amanda.py", line 152, in
main()
File "/home/phunehehe/check-amanda/check-amanda.py", line 143, in main
random_file = get_file_list(config, hostname, disk)
File "/home/phunehehe/check-amanda/check-amanda.py", line 79, in get_file_list
current_path = choice(paths)
File "/usr/lib/python2.7/random.py", line 274, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
IndexError: list index out of range
```
happens when the selected directory is empty