[lxc-devel] [pylxd/master] Unused code

d0ugal on Github lxc-bot at linuxcontainers.org
Fri Dec 4 17:08:26 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 302 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201204/5db95881/attachment.bin>
-------------- next part --------------
From b3b67fe0e68423fc2f85bccf1f20acdb779a38ba Mon Sep 17 00:00:00 2001
From: Dougal Matthews <dougal at dougalmatthews.com>
Date: Fri, 4 Dec 2020 16:51:41 +0000
Subject: [PATCH 1/2] Remove unused testing utility function

Signed-off-by: Dougal Matthews <dougal at dougalmatthews.com>
---
 pylxd/deprecated/tests/utils.py | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/pylxd/deprecated/tests/utils.py b/pylxd/deprecated/tests/utils.py
index 9a3270c9..c2e0859c 100644
--- a/pylxd/deprecated/tests/utils.py
+++ b/pylxd/deprecated/tests/utils.py
@@ -13,27 +13,6 @@
 #    under the License.
 
 from pylxd import api
-from pylxd import exceptions as lxd_exceptions
-
-
-def upload_image(image):
-    alias = "{}/{}/{}/{}".format(
-        image["os"], image["release"], image["arch"], image["variant"]
-    )
-    lxd = api.API()
-    imgs = api.API(host="images.linuxcontainers.org")
-    d = imgs.alias_show(alias)
-
-    meta = d[1]["metadata"]
-    tgt = meta["target"]
-
-    try:
-        lxd.alias_update(meta)
-    except lxd_exceptions.APIError as ex:
-        if ex.status_code == 404:
-            lxd.alias_create(meta)
-
-    return tgt
 
 
 def delete_image(image):

From a87a3f35fac24d0f1b6a1eddfc76029565fa19e9 Mon Sep 17 00:00:00 2001
From: Dougal Matthews <dougal at dougalmatthews.com>
Date: Fri, 4 Dec 2020 16:52:42 +0000
Subject: [PATCH 2/2] Remove unused testing utility method delete_image

Signed-off-by: Dougal Matthews <dougal at dougalmatthews.com>
---
 pylxd/deprecated/tests/utils.py | 20 --------------------
 1 file changed, 20 deletions(-)
 delete mode 100644 pylxd/deprecated/tests/utils.py

diff --git a/pylxd/deprecated/tests/utils.py b/pylxd/deprecated/tests/utils.py
deleted file mode 100644
index c2e0859c..00000000
--- a/pylxd/deprecated/tests/utils.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright (c) 2015 Canonical Ltd
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-from pylxd import api
-
-
-def delete_image(image):
-    lxd = api.API()
-    lxd.image_delete(image)


More information about the lxc-devel mailing list