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

ConvertStringToHashtable should return sorted Hashtable #61

Open
SSvilen opened this issue May 31, 2019 · 0 comments
Open

ConvertStringToHashtable should return sorted Hashtable #61

SSvilen opened this issue May 31, 2019 · 0 comments

Comments

@SSvilen
Copy link

SSvilen commented May 31, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant