Skip to content

symlinked pump names don't work as expected #25

@reidsunderland

Description

@reidsunderland

@andreleblanc11 noticed this.

When the pump name directory is a symlink, sr3_tools uses the link target as the pump name.

e.g.:

sr3-config/
├── _dsh_config
├── cluster_A -> cluster_1/
└── cluster_1

# we're in the cluster_A pump directory, but sr3_tools uses cluster_1 as the pump name
user@srv:~/sr3-config/cluster_A$ sr3l pwd
Data Pump Name: cluster_1. DSH Machine List: /home/user/sr3-config/_dsh_config/cluster_1.list

This is a good thing if you want cluster_A to just be an alternative name for cluster_1.

But it's bad if you want cluster_A and cluster_1 to be different clusters that share the same configs.

The problem comes from this line in the code:

pump_name=$(pwd -P | sed "s|$(git rev-parse --show-toplevel)||g" | cut -d '/' -f 2)

git rev-parse --show-toplevel always returns a real path and when I wrote it, I wanted to ensure it would work on a system that used symlinked home directories so I used pwd -P.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions