fix pk lookups
diff --git a/plstackapi/core/api/nodes.py b/plstackapi/core/api/nodes.py
index 47934ba..9b6a65c 100644
--- a/plstackapi/core/api/nodes.py
+++ b/plstackapi/core/api/nodes.py
@@ -1,14 +1,17 @@
+from types import StringTypes
from plstackapi.openstack.client import OpenStackClient
from plstackapi.openstack.driver import OpenStackDriver
from plstackapi.core.api.auth import auth_check
from plstackapi.core.models import Node
def _get_nodes(filter):
+ if isinstance(filter, StringTypes) and filter.isdigit():
+ filter = int(filter)
if isinstance(filter, int):
nodes = Node.objects.filter(id=filter)
elif isinstance(filter, StringTypes):
nodes = Node.objects.filter(name=filter)
- elif isinstance(filer, dict):
+ elif isinstance(filter, dict):
nodes = Node.objects.filter(**filter)
else:
nodes = []