diff mbox

[ovs-dev] debian: Remove old PKI directory migration code

Message ID 1450838495-18542-1-git-send-email-aatteka@nicira.com
State Accepted
Headers show

Commit Message

Ansis Atteka Dec. 23, 2015, 2:41 a.m. UTC
Open vSwitch 1.3 and older was creating certificates and private
key in /usr/share/openvswitch/pki.  However, since PKI directory
is mutable, then this was considered a bug and PKI directory was
moved to /var directory in Open vSwitch 1.4 Commit 14bd2d51 (debian:
Move PKI directory to FHS-compliant location.)

Note, that Ubuntu 12.04 already was shipping with Open vSwitch 1.4
and should have created (in case of fresh install) or moved (in
case of upgrade from Open vSwitch 1.3) this directory to the right
location.

So I am inclined to remove this code because the only reason for it
to exist would be, if someone would be upgrading from Open vSwitch
1.3 or older version directly to 2.5 without using any intermediary
upgrade releases.

Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
---
 debian/openvswitch-pki.postinst            | 8 --------
 debian/openvswitch-pki.postrm              | 5 -----
 debian/openvswitch-testcontroller.postinst | 8 --------
 3 files changed, 21 deletions(-)

Comments

Ben Pfaff Dec. 23, 2015, 6:11 a.m. UTC | #1
On Tue, Dec 22, 2015 at 06:41:35PM -0800, Ansis Atteka wrote:
> Open vSwitch 1.3 and older was creating certificates and private
> key in /usr/share/openvswitch/pki.  However, since PKI directory
> is mutable, then this was considered a bug and PKI directory was
> moved to /var directory in Open vSwitch 1.4 Commit 14bd2d51 (debian:
> Move PKI directory to FHS-compliant location.)
> 
> Note, that Ubuntu 12.04 already was shipping with Open vSwitch 1.4
> and should have created (in case of fresh install) or moved (in
> case of upgrade from Open vSwitch 1.3) this directory to the right
> location.
> 
> So I am inclined to remove this code because the only reason for it
> to exist would be, if someone would be upgrading from Open vSwitch
> 1.3 or older version directly to 2.5 without using any intermediary
> upgrade releases.
> 
> Signed-Off-By: Ansis Atteka <aatteka@nicira.com>

Thanks for noticing.

Acked-by: Ben Pfaff <blp@ovn.org>
Ansis Dec. 23, 2015, 9:21 p.m. UTC | #2
On 22 December 2015 at 22:11, Ben Pfaff <blp@ovn.org> wrote:

> On Tue, Dec 22, 2015 at 06:41:35PM -0800, Ansis Atteka wrote:
> > Open vSwitch 1.3 and older was creating certificates and private
> > key in /usr/share/openvswitch/pki.  However, since PKI directory
> > is mutable, then this was considered a bug and PKI directory was
> > moved to /var directory in Open vSwitch 1.4 Commit 14bd2d51 (debian:
> > Move PKI directory to FHS-compliant location.)
> >
> > Note, that Ubuntu 12.04 already was shipping with Open vSwitch 1.4
> > and should have created (in case of fresh install) or moved (in
> > case of upgrade from Open vSwitch 1.3) this directory to the right
> > location.
> >
> > So I am inclined to remove this code because the only reason for it
> > to exist would be, if someone would be upgrading from Open vSwitch
> > 1.3 or older version directly to 2.5 without using any intermediary
> > upgrade releases.
> >
> > Signed-Off-By: Ansis Atteka <aatteka@nicira.com>
>
> Thanks for noticing.


> Acked-by: Ben Pfaff <blp@ovn.org>
>

Thanks for review. I pushed this to master and 2.5.
diff mbox

Patch

diff --git a/debian/openvswitch-pki.postinst b/debian/openvswitch-pki.postinst
index f4705e9..75b4777 100755
--- a/debian/openvswitch-pki.postinst
+++ b/debian/openvswitch-pki.postinst
@@ -19,14 +19,6 @@  set -e
 
 case "$1" in
     configure)
-        # Move the pki directory from its previous, non FHS-compliant location,
-        # to its new location, leaving behind a symlink for compatibility.
-        if test -d /usr/share/openvswitch/pki && \
-           test ! -e /var/lib/openvswitch/pki; then
-            mv /usr/share/openvswitch/pki /var/lib/openvswitch
-            ln -s /var/lib/openvswitch/pki /usr/share/openvswitch/pki
-        fi
-
         # Create certificate authorities.
         if test ! -e /var/lib/openvswitch/pki; then
             ovs-pki init
diff --git a/debian/openvswitch-pki.postrm b/debian/openvswitch-pki.postrm
index bc91e13..5db4d6b 100755
--- a/debian/openvswitch-pki.postrm
+++ b/debian/openvswitch-pki.postrm
@@ -22,11 +22,6 @@  set -e
 case "$1" in
     purge)
         rm -f /var/log/openvswitch/ovs-pki.log* || true
-
-        # Remove backward compatibility symlink, if present.
-        if test -h /usr/share/openvswitch/pki; then
-            rm -f /usr/share/openvswitch/pki
-        fi
         ;;
 
     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
diff --git a/debian/openvswitch-testcontroller.postinst b/debian/openvswitch-testcontroller.postinst
index 7242b4a..7a25083 100755
--- a/debian/openvswitch-testcontroller.postinst
+++ b/debian/openvswitch-testcontroller.postinst
@@ -21,14 +21,6 @@  set -e
 case "$1" in
     configure)
         cd /etc/openvswitch-testcontroller
-
-        # If cacert.pem is a symlink to the old location for cacert.pem,
-        # remove it so that we can symlink it to the new location.
-        if test -h cacert.pem && \
-           test X"`readlink cacert.pem`" = X/usr/share/openvswitch/pki/switchca/cacert.pem; then
-            rm -f cacert.pem
-        fi
-
         if ! test -e cacert.pem; then
             ln -s /var/lib/openvswitch/pki/switchca/cacert.pem cacert.pem
         fi