fix pk lookups
diff --git a/plstackapi/core/api/keys.py b/plstackapi/core/api/keys.py
index 2c90140..42ffe46 100644
--- a/plstackapi/core/api/keys.py
+++ b/plstackapi/core/api/keys.py
@@ -1,3 +1,4 @@
+from types import StringTypes
from plstackapi.openstack.client import OpenStackClient
from plstackapi.openstack.driver import OpenStackDriver
from plstackapi.core.api.auth import auth_check
@@ -6,11 +7,13 @@
def _get_keys(filter):
+ if isinstance(filter, StringTypes) and filter.isdigit():
+ filter = int(filter)
if isinstance(filter, int):
keys = Key.objects.filter(id=filter)
elif isinstance(filter, StringTypes):
keys = Key.objects.filter(name=filter)
- elif isinstance(filer, dict):
+ elif isinstance(filter, dict):
keys = Key.objects.filter(**filter)
else:
keys = []