chiark / gitweb /
import: three minor fixes
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2014 15:43:46 +0000 (16:43 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 24 Dec 2014 15:53:05 +0000 (16:53 +0100)
src/import/import-dkr.c
src/import/import.c

index 05b1062..8f26191 100644 (file)
@@ -1131,7 +1131,7 @@ int dkr_import_pull(DkrImport *import, const char *name, const char *tag, const
                 n->force_local = force_local;
         }
 
-        r = hashmap_put(import->names, name, n);
+        r = hashmap_put(import->names, n->name, n);
         if (r < 0)
                 return r;
 
index 8b9ca4f..54f3113 100644 (file)
@@ -73,7 +73,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
                         local = name;
         }
 
-        if (streq(local, "-") || isempty(local))
+        if (isempty(local) || streq(local, "-"))
                 local = NULL;
 
         if (!dkr_name_is_valid(name)) {
@@ -89,7 +89,7 @@ static int pull_dkr(int argc, char *argv[], void *userdata) {
         if (local) {
                 const char *p;
 
-                if (!machine_name_is_valid(tag)) {
+                if (!machine_name_is_valid(local)) {
                         log_error("Local image name '%s' is not valid.", local);
                         return -EINVAL;
                 }