Merge lp:~xnox/apt-btrfs-snapshot/pep8 into lp:apt-btrfs-snapshot

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 48
Proposed branch: lp:~xnox/apt-btrfs-snapshot/pep8
Merge into: lp:apt-btrfs-snapshot
Diff against target: 76 lines (+17/-9)
3 files modified
apt_btrfs_snapshot.py (+10/-8)
debian/changelog (+6/-0)
test/test_apt_btrfs_snapshot.py (+1/-1)
To merge this branch: bzr merge lp:~xnox/apt-btrfs-snapshot/pep8
Reviewer Review Type Date Requested Status
Michael Vogt Approve
Review via email: mp+142023@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

Looks good, thanks. I personally prefer lines 8, 43 to be in the same line but thats a tiny detail.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'apt_btrfs_snapshot.py'
--- apt_btrfs_snapshot.py 2012-07-12 11:30:15 +0000
+++ apt_btrfs_snapshot.py 2013-01-06 02:46:20 +0000
@@ -128,9 +128,10 @@
128 def _get_supported_btrfs_root_fstab_entry(self):128 def _get_supported_btrfs_root_fstab_entry(self):
129 """ return the supported btrfs root FstabEntry or None """129 """ return the supported btrfs root FstabEntry or None """
130 for entry in self.fstab:130 for entry in self.fstab:
131 if (entry.mountpoint == "/" and131 if (
132 entry.fstype == "btrfs" and132 entry.mountpoint == "/" and
133 "subvol=@" in entry.options):133 entry.fstype == "btrfs" and
134 "subvol=@" in entry.options):
134 return entry135 return entry
135 return None136 return None
136137
@@ -213,7 +214,7 @@
213 try:214 try:
214 print("Available snapshots older than '%s':" % timefmt)215 print("Available snapshots older than '%s':" % timefmt)
215 print(" \n".join(self.get_btrfs_root_snapshots_list(216 print(" \n".join(self.get_btrfs_root_snapshots_list(
216 older_than=older_than_unixtime)))217 older_than=older_than_unixtime)))
217 except AptBtrfsRootWithNoatimeError:218 except AptBtrfsRootWithNoatimeError:
218 sys.stderr.write("Error: fstab option 'noatime' incompatible "219 sys.stderr.write("Error: fstab option 'noatime' incompatible "
219 "with option")220 "with option")
@@ -225,7 +226,7 @@
225 older_than_unixtime = self._parse_older_than_to_unixtime(timefmt)226 older_than_unixtime = self._parse_older_than_to_unixtime(timefmt)
226 try:227 try:
227 for snap in self.get_btrfs_root_snapshots_list(228 for snap in self.get_btrfs_root_snapshots_list(
228 older_than=older_than_unixtime):229 older_than=older_than_unixtime):
229 res &= self.delete_snapshot(snap)230 res &= self.delete_snapshot(snap)
230 except AptBtrfsRootWithNoatimeError:231 except AptBtrfsRootWithNoatimeError:
231 sys.stderr.write("Error: fstab option 'noatime' incompatible with "232 sys.stderr.write("Error: fstab option 'noatime' incompatible with "
@@ -241,9 +242,10 @@
241 """ set new default """242 """ set new default """
242 mp = self.mount_btrfs_root_volume()243 mp = self.mount_btrfs_root_volume()
243 new_root = os.path.join(mp, snapshot_name)244 new_root = os.path.join(mp, snapshot_name)
244 if (os.path.isdir(new_root) and245 if (
245 snapshot_name.startswith("@") and246 os.path.isdir(new_root) and
246 snapshot_name != "@"):247 snapshot_name.startswith("@") and
248 snapshot_name != "@"):
247 default_root = os.path.join(mp, "@")249 default_root = os.path.join(mp, "@")
248 backup = os.path.join(mp, self.BACKUP_PREFIX + self._get_now_str())250 backup = os.path.join(mp, self.BACKUP_PREFIX + self._get_now_str())
249 os.rename(default_root, backup)251 os.rename(default_root, backup)
250252
=== modified file 'debian/changelog'
--- debian/changelog 2012-10-26 09:27:26 +0000
+++ debian/changelog 2013-01-06 02:46:20 +0000
@@ -1,3 +1,9 @@
1apt-btrfs-snapshot (0.3.4.1) raring; urgency=low
2
3 * Fix FTBFS due to newer, more strict, pep8.
4
5 -- Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com> Sun, 06 Jan 2013 02:41:49 +0000
6
1apt-btrfs-snapshot (0.3.4) raring; urgency=low7apt-btrfs-snapshot (0.3.4) raring; urgency=low
28
3 * Build depend on python3-all.9 * Build depend on python3-all.
410
=== modified file 'test/test_apt_btrfs_snapshot.py'
--- test/test_apt_btrfs_snapshot.py 2012-07-12 07:31:09 +0000
+++ test/test_apt_btrfs_snapshot.py 2013-01-06 02:46:20 +0000
@@ -16,7 +16,7 @@
16from apt_btrfs_snapshot import (16from apt_btrfs_snapshot import (
17 AptBtrfsSnapshot,17 AptBtrfsSnapshot,
18 AptBtrfsRootWithNoatimeError,18 AptBtrfsRootWithNoatimeError,
19 )19)
2020
2121
22class TestFstab(unittest.TestCase):22class TestFstab(unittest.TestCase):

Subscribers

People subscribed via source and target branches