From 2205f431b9f0ae0800e57f5f56aa68e3ac6edad2 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatt Date: Mon, 28 Oct 2024 16:41:30 +0530 Subject: [PATCH] Added snap commands for symlinking Signed-off-by: Utkarsh Bhatt --- snap/hooks/install | 3 ++- snap/hooks/remove | 4 +++- snap/snapcraft.yaml | 10 ++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/snap/hooks/install b/snap/hooks/install index 5eb89735..0928b5be 100755 --- a/snap/hooks/install +++ b/snap/hooks/install @@ -4,4 +4,5 @@ conf="${SNAP_DATA}/conf" mkdir -p -m 0755 "${conf}" cp "${SNAP}/share/metadata.yaml" "${conf}" -# add a symlink to etc/ceph \ No newline at end of file +# TODO: add a symlink to etc/ceph +ln -s $conf /etc/ceph \ No newline at end of file diff --git a/snap/hooks/remove b/snap/hooks/remove index 766415cb..fe6f14cb 100644 --- a/snap/hooks/remove +++ b/snap/hooks/remove @@ -1,3 +1,5 @@ #!/bin/sh set -uex -# remove the symlink to etc/ceph \ No newline at end of file +conf="${SNAP_DATA}/conf" +# TODO: remove the symlink to etc/ceph +rm $conf \ No newline at end of file diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b909162f..da58b597 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -16,6 +16,10 @@ plugs: modules: - name: rbd load: on-boot + etc-ceph: + interface: system-files + read: /etc/ceph + write: /etc/ceph slots: ceph-conf: @@ -24,12 +28,6 @@ slots: read: - "$SNAP_DATA/conf" -plugs: - etc-ceph: - interface: system-files - read: /etc/ceph - write: /etc/ceph - environment: LD_LIBRARY_PATH: $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ceph:$SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ceph:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ceph/compressor:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ceph/crypto:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ceph/erasure-code PYTHONPATH: $SNAP/lib/python3/dist-packages