From 9865b9a1d0d9996ad31894cb0e2d69bff17c9b66 Mon Sep 17 00:00:00 2001 From: Martin Skuta Date: Sat, 9 Mar 2019 16:42:01 +0100 Subject: [PATCH 1/2] Add missing hyphen to MegaCli option The command also works without the hyphen. Seems to be another one of the peculiarities of MegaCli. --- pymegacli/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymegacli/components.py b/pymegacli/components.py index f46d7a1..cf597ed 100644 --- a/pymegacli/components.py +++ b/pymegacli/components.py @@ -276,7 +276,7 @@ def patrol_read_status(self): @property def PDs(self): return Disk.from_output(self.parent.run_command( - '-PDList', 'a%d' % self.controller_number + '-PDList', '-a%d' % self.controller_number ), self) @property From a0a804a9f8a67ff9a2ee43a99536326b8af8343f Mon Sep 17 00:00:00 2001 From: Martin Skuta Date: Sat, 9 Mar 2019 16:50:27 +0100 Subject: [PATCH 2/2] Do not let MegaCli write a log file Without the proper option, MegaCli always copies its output to a file named `MegaSAS.log` and causes pymegacli to leave unwanted traces. --- pymegacli/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymegacli/components.py b/pymegacli/components.py index cf597ed..508be25 100644 --- a/pymegacli/components.py +++ b/pymegacli/components.py @@ -24,7 +24,7 @@ def __init__(self, megacli_path, log=None): def run_command(self, *args): exit_re = re.compile('^Exit Code: (.*)$') - cmd = [self.megacli_path] + list(args) + cmd = [self.megacli_path] + list(args) + ['-NoLog'] if self.log: self.log.debug('executing: ' + ' '.join(map(pipes.quote, cmd))) p = subprocess.Popen(