sassoftware / sassoftware/pyviyatools

Validate caslib exists in /createpublishdest.py cas before creating publishing destination

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
50
Forks
42
PR merge metrics
No merged PRs in 30d

Description

Attempting to create CAS pub dest in nonexistant caslib with createpublishdest.py half-works but should fail.

You can run createpublishdest.py using a command such as the following, where the argument -c nonexistantcaslib passes in the name of a CAS library which does not exist:

./createpublishdest.py cas -n newcasdest -s cas-shared-default -c nonexistantcaslib -t thetable

The command succeeds, reporting that it has created a publishing destination. However, the publishing destination does not appear in the SAS Environment Manager Publishing Destinations page. Attempting to re-run the same command results in an HTTP 409 response something like this:

{"errorCode":21904,"message":"The destination name \"newcasdest\" is already in use. You must specify a unique name.","details":["traceId: 66a865672d30378b","path: /modelPublish/destinations/"],"links":[],"version":2,"httpStatusCode":409}

Modify createpublishdest.py so that for a CAS publishing destination, it validates that the CAS library exists before proceeding to attempt to create the publishing destination which uses it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in createpublishdest.py and trace the cas publishing-destination path invoked by the example command. Add validation that the supplied CAS library exists before attempting destination creation. Run the command with nonexistantcaslib and verify it fails without reporting success or leaving a destination that causes an HTTP 409 on retry.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.