oz123 10 years ago
parent
commit
f95f5ca57f

+ 3 - 3
pwman/data/drivers/postgresql.py

@@ -90,14 +90,14 @@ class PostgresqlDatabase(Database):
             rid = self._cur.fetchone()[0]
             return rid
 
-    def _clean_orphands(self):
+    def _clean_orphans(self):
         clean = ("delete from tag where not exists "
                  "(select 'x' from lookup l where l.tagid = tag.id)")
         self._cur.execute(clean)
         self._con.commit()
 
     def close(self):
-        self._clean_orphands()
+        self._clean_orphans()
         self._cur.close()
         self._con.close()
 
@@ -147,7 +147,7 @@ class PostgresqlDatabase(Database):
         pass
 
     def listtags(self):
-        self._clean_orphands()
+        self._clean_orphans()
         get_tags = "select data from tag"
         self._cur.execute(get_tags)
         tags = self._cur.fetchall()

+ 3 - 3
pwman/data/drivers/sqlite.py

@@ -68,7 +68,7 @@ class SQLite(Database):
             return [id[0] for id in ids]
 
     def listtags(self):
-        self._clean_orphands()
+        self._clean_orphans()
         get_tags = "select data from tag"
         self._cur.execute(get_tags)
         tags = self._cur.fetchall()
@@ -204,7 +204,7 @@ class SQLite(Database):
         self._cur.execute(sql_rm, (nids))
         self._con.commit()
 
-    def _clean_orphands(self):
+    def _clean_orphans(self):
         clean = ("delete from tag where not exists "
                  "(select 'x' from lookup l where l.tagid = tag.id)")
 
@@ -233,6 +233,6 @@ class SQLite(Database):
             return None
 
     def close(self):
-        self._clean_orphands()
+        self._clean_orphans()
         self._cur.close()
         self._con.close()

+ 2 - 2
pwman/tests/test_postgresql.py

@@ -77,9 +77,9 @@ class TestPostGresql(unittest.TestCase):
 
         self.assertEqual(s, s1)
 
-    def test_7a_clean_orphands(self):
+    def test_7a_clean_orphans(self):
 
-        self.db._clean_orphands()
+        self.db._clean_orphans()
         rv = self.db._get_tag("SECRET")
         self.assertIsNone(rv)
 

+ 3 - 3
pwman/tests/test_sqlite.py

@@ -127,14 +127,14 @@ class TestSQLite(unittest.TestCase):
         self.assertEqual(rv, (u'transparent', u'notsecret'))
         node = {'user': 'modify', 'password': 'notsecret',
                 'tags': ['foo', 'auto']}
-        # now the tags bank and baz are orphand ...
+        # now the tags bank and baz are orphan ...
         # what happens? it should be completely removed.
         # To spare IO we only delete orphand tags when
         # db.close is called.
         self.db.editnode('2', **node)
 
-    def test_9_test_orphands(self):
-        self.db._clean_orphands()
+    def test_9_test_orphans(self):
+        self.db._clean_orphans()
         ce = CryptoEngine.get()
         baz_encrypted = ce.encrypt(u'baz').decode()