Skip to content

MDSplus should not allow creation of node names that contain illegal characters #3064

Description

@mwinkel-dev

Affiliation
GA DIII-D (submitted on behalf of Martin M.)

Version(s) Affected
All versions

Platform(s)
All platforms

Installation Method(s)
The RPM packages

Describe the bug
The Python API allowed creation of node names that contain -. This posed problems because TCL's set default command won't accept a node name that contains a hyphen.

The same problem arises when using TCL to create node names. Thus, it likely applies to all APIs.

To Reproduce

This simple TCL script illustrates the problem.

% mdstcl
TCL> edit stuff /shot=123 /new
TCL> add node structure1 /usage=structure
TCL> add node structure-2 /usage=structure
TCL> write
TCL> dir

\STUFF::TOP

  STRUCTURE-2   STRUCTURE1  

Total of 2 nodes.
TCL> set default structure1
TCL> dir


Total of 0 nodes.
TCL> set default -.
TCL> dir

\STUFF::TOP

  STRUCTURE-2   STRUCTURE1  

Total of 2 nodes.
TCL> set default structure-2
Error: Problem setting default to node 'structure-2'
Error message was: %TREE-W-NNF, Node Not Found
mdsdcl: --> failed on line 'set default structure-2'
TCL>
TCL> set default 'structure-2'
Error: Problem setting default to node ''structure-2''
Error message was: %TREE-E-INVPATH, Invalid tree pathname specified
mdsdcl: --> failed on line 'set default 'structure-2''
TCL>
TCL> set default "structure-2"
Error: Problem setting default to node 'structure-2'
Error message was: %TREE-W-NNF, Node Not Found
mdsdcl: --> failed on line 'set default "structure-2"'
TCL>
TCL> set default "str*2"
Error: Problem setting default to node 'str*2'
Error message was: %TREE-E-NOWILD, No wildcard characters permitted in node specifier
mdsdcl: --> failed on line 'set default "str*2"'
TCL> 

Expected behavior
The various APIs and utilities provided by MDSplus should be consistent regarding the syntax for node names. Furthermore, the APIs and utilities should not allow creation of node names that do not conform to that syntax.

Screenshots
n/a

Additional context
Note that the MDSplus documentation is also inconsistent about the syntax of node names. The following two definitions differ regarding $ (but both do exclude -).

The reference documentation for TCL's add node command states: "Node names must not exceed 12 characters, begin with an alphabetic character and contain any characters from the set A-Z,0-9, dollar and underscore."

TCL's help add node command contains this description: "Node names must begin with an alphabetic character followed by zero or more alphanumeric or underscore characters. The node name must be 12 characters or less in length."

Metadata

Metadata

Assignees

No one assigned

    Labels

    US Priorityapi/pythonRelates to the Python APIbugAn unexpected problem or unintended behaviordocumentationThis is a need for, or an addition to the documentationtool/tclRelates to the Tree Control Language or mdstcl prompt

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions