JEA icon indicating copy to clipboard operation
JEA copied to clipboard

ConvertStringToHashtable should return sorted Hashtable

Open SSvilen opened this issue 5 years ago • 0 comments

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.

SSvilen avatar May 31 '19 09:05 SSvilen