summaryrefslogtreecommitdiff
diff options
authorMaciej Kisielewski <maciej.kisielewski@canonical.com>2018-06-21 13:14:16 +0200
committerMaciej Kisielewski <maciej.kisielewski@canonical.com>2018-06-21 13:14:16 +0200
commit01ee89075c87a80af3149b4c3fcdafec57e25255 (patch)
tree7e663c9f376090b9b62c4ec238ce5c1cc0faf07e
parent8060f0341ef10727c400bf73e45247c06f3338f6 (diff)
pm_test: fix crash on SUT with missing lightdm.conf
The file is not mandatory, so shouldn't expect the file to be present. Signed-off-by: Maciej Kisielewski <maciej.kisielewski@canonical.com>
-rwxr-xr-xbin/pm_test10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/pm_test b/bin/pm_test
index a5cd024..e8e6263 100755
--- a/bin/pm_test
+++ b/bin/pm_test
@@ -575,11 +575,11 @@ autologin-user-timeout=0
shutil.copystat(self.config_filename, backup_filename)
break
- with open(self.config_filename, 'w') as f:
- if self.config_filename == '/etc/lightdm/lightdm.conf':
- f.write(self.template.format(username=self.user))
- elif self.config_filename == '/etc/gdm3/custom.conf':
- self.parser.write(f)
+ with open(self.config_filename, 'w') as f:
+ if self.config_filename == '/etc/lightdm/lightdm.conf':
+ f.write(self.template.format(username=self.user))
+ elif self.config_filename == '/etc/gdm3/custom.conf':
+ self.parser.write(f)
def disable(self):
"""