Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

ConvertStringToHashtable should return sorted Hashtable  #61

@SSvilen

Description

@SSvilen

I have a MOF file, which has RoleDefinitions hashtable as string. The hashtable itself is not sorted.
RoleDefinitions = "@{'test\\svilen-t' = @{'RoleCapabilities' = 'Role1'};'test\\TestGroup' = @{'RoleCapabilities' = 'Role1'};'test\\svilen' = @{'RoleCapabilities' = 'Role2'}}";

When I do test I get the following:

VERBOSE: [TESTSERVER]:                            [[WACJeaEndpoint]Endpoint] Argument1: {
    "test\\TestGroup":  {
                              "RoleCapabilities":  "Role1"
                          },
    "test\\svilen":  {
                            "RoleCapabilities":  "Role2"
                        },
    "test\\svilen-t":  {
                              "RoleCapabilities":  "Role1"
                          }
}
VERBOSE: [TESTSERVER]:                            [[WACJeaEndpoint]Endpoint] Argument2: {
    "test\\svilen":  {
                            "RoleCapabilities":  "Role2"
                        },
    "test\\TestGroup":  {
                              "RoleCapabilities":  "Role1"
                          },
    "test\\svilen-t":  {
                              "RoleCapabilities":  "Role1"
                          }
}
VERBOSE: [TESTSERVER]:                            [[WACJeaEndpoint]Endpoint] RoleDfinitions not equal: @{
    'test\svilen' = @{
        'RoleCapabilities' = 'Role2' }
    'test\svilen-t' = @{
        'RoleCapabilities' = 'Role1' }
    'test\TestGroup' = @{
        'RoleCapabilities' = 'Role1' } }

The both hashtables are obviously equal. Expected is:

VERBOSE: [TestServer]:                            [[WACJeaEndpoint]Endpoint] string
VERBOSE: [TestServer]:                            [[WACJeaEndpoint]Endpoint] Argument1: {
    "Test\\TestGroup":  {
                              "RoleCapabilities":  "Role1"
                          },
    "Test\\svilen":  {
                            "RoleCapabilities":  "Role2"
                        },
    "Test\\svilen-t":  {
                              "RoleCapabilities":  "Role1"
                          }
}
VERBOSE: [TestServer]:                            [[WACJeaEndpoint]Endpoint] Argument2: {
    "Test\\TestGroup":  {
                              "RoleCapabilities":  "Role1"
                          },
    "Test\\svilen":  {
                            "RoleCapabilities":  "Role2"
                        },
    "Test\\svilen-t":  {
                              "RoleCapabilities":  "Role1"
                          }
}

To me, it looks like SafeGetValue() works different on both ASTs (the one from the current PSSC file and the one from the MOF file.)
I'm ready to open PR for that, if you belive that this is really an issue.

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