Closed pxn closed 2 years ago
@pxn i tried in simulator and though the code looks good; notice all the double-double quotes around strings, i.e. "{""haenable"":false,""hastate"":""Disabled""}"
Apache CloudStack 🐵 CloudMonkey 6.2.0
Report issues: https://github.com/apache/cloudstack-cloudmonkey/issues
(localcloud) 🐱 > set output csv
(localcloud) 🐱 > list hosts
created,disconnected,events,hasannotations,hostha,id,ipaddress,islocalstorageactive,lastpinged,memoryallocated,name,outofbandmanagement,podid,podname,resourcestate,state,type,version,zoneid,zonename
2021-10-13T10:20:47+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; Remove; PingTimeout; HostDown; WaitedTooLong; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",361d22fe-aa9a-4f52-af9e-c04cb4ab2f17,172.16.200.130,false,1970-01-19T12:16:55+0100,0,s-3-VM,"{""enabled"":false,""powerstate"":""Disabled""}",2b051816-7ca8-44a1-b95c-fcf7758a7dc7,Z2P1,Enabled,Disconnected,SecondaryStorageVM,4.16.0.0-SNAPSHOT,0f42411d-0490-4a07-b114-7a383aa46adc,zim2
2021-10-13T10:16:31+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",aa256449-6b65-4d4a-ad37-6bf26026d80e,172.16.200.15,false,1970-01-19T12:17:05+0100,0,SimulatedAgent.6cec6b85-fe3f-4b3d-9d58-2261ff5dbb45,"{""enabled"":false,""powerstate"":""Disabled""}",2b051816-7ca8-44a1-b95c-fcf7758a7dc7,Z2P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,0f42411d-0490-4a07-b114-7a383aa46adc,zim2
2021-10-13T10:16:31+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",e4ac7d40-e45c-435b-b734-91b47ae91c15,172.16.200.1,false,1970-01-19T12:17:05+0100,0,SimulatedAgent.ed7c811b-7b6c-47ba-9eb0-01fb8a6c5219,"{""enabled"":false,""powerstate"":""Disabled""}",2b051816-7ca8-44a1-b95c-fcf7758a7dc7,Z2P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,0f42411d-0490-4a07-b114-7a383aa46adc,zim2
2021-10-13T10:15:31+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",b5635146-8d6a-4d77-b863-820b1e049c41,172.16.200.7,false,1970-01-19T12:17:05+0100,536870912,SimulatedAgent.9e78d6b4-8700-48c9-8b80-77f4e1486ae3,"{""enabled"":false,""powerstate"":""Disabled""}",2b051816-7ca8-44a1-b95c-fcf7758a7dc7,Z2P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,0f42411d-0490-4a07-b114-7a383aa46adc,zim2
2021-10-13T10:15:30+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",ba57ee9b-1b52-4234-8866-f0248d32cd57,172.16.200.0,false,1970-01-19T12:17:05+0100,1073741824,SimulatedAgent.ad025904-54be-43cf-b250-a32f0b5f8f5c,"{""enabled"":false,""powerstate"":""Disabled""}",2b051816-7ca8-44a1-b95c-fcf7758a7dc7,Z2P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,0f42411d-0490-4a07-b114-7a383aa46adc,zim2
2021-10-13T10:15:17+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; Remove; PingTimeout; HostDown; WaitedTooLong; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",557f3ea0-1cc6-423f-83fc-2d52de4eb450,172.16.100.131,false,1970-01-19T12:16:55+0100,0,s-1-VM,"{""enabled"":false,""powerstate"":""Disabled""}",45ba35fb-2558-4e66-b42c-cd9d1733adb4,Z1P1,Enabled,Disconnected,SecondaryStorageVM,4.16.0.0-SNAPSHOT,88412f0d-8d95-434f-a827-dd5ad84245e3,zim1
2021-10-13T10:11:12+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",3e435aff-4cdf-4678-a452-abb2825779af,172.16.100.13,false,1970-01-19T12:17:05+0100,0,SimulatedAgent.bbf75cd1-ff78-4bdf-b57d-b6dcb785f780,"{""enabled"":false,""powerstate"":""Disabled""}",45ba35fb-2558-4e66-b42c-cd9d1733adb4,Z1P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,88412f0d-8d95-434f-a827-dd5ad84245e3,zim1
2021-10-13T10:11:12+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",67fef2a3-aac0-4061-941c-5f7037c36765,172.16.100.8,false,1970-01-19T12:17:05+0100,0,SimulatedAgent.f4a75f53-3efa-486a-99b1-a2de47090663,"{""enabled"":false,""powerstate"":""Disabled""}",45ba35fb-2558-4e66-b42c-cd9d1733adb4,Z1P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,88412f0d-8d95-434f-a827-dd5ad84245e3,zim1
2021-10-13T10:10:12+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",2f5c510a-6ee8-4cad-a930-c79db1e30ad6,172.16.100.12,false,1970-01-19T12:17:05+0100,1073741824,SimulatedAgent.541c09b4-b177-4ebb-a58f-c2a44b85b9ea,"{""enabled"":false,""powerstate"":""Disabled""}",45ba35fb-2558-4e66-b42c-cd9d1733adb4,Z1P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,88412f0d-8d95-434f-a827-dd5ad84245e3,zim1
2021-10-13T10:10:11+0200,2021-10-13T10:43:21+0200,AgentDisconnected; ManagementServerDown; StartAgentRebalance; Remove; PingTimeout; HostDown; ShutdownRequested; Ping; AgentConnected,false,"{""haenable"":false,""hastate"":""Disabled""}",ce194bce-fab2-41ba-99cc-df8a46e4c31b,172.16.100.8,false,1970-01-19T12:17:05+0100,536870912,SimulatedAgent.3e98f022-1aa3-4f04-86fc-10fd9ccdecb7,"{""enabled"":false,""powerstate"":""Disabled""}",45ba35fb-2558-4e66-b42c-cd9d1733adb4,Z1P1,Enabled,Up,Routing,4.16.0.0-SNAPSHOT,88412f0d-8d95-434f-a827-dd5ad84245e3,zim1
Double double-quotes are escape seq for double-quote in CSV format, see RFC 4180 [https://datatracker.ietf.org/doc/html/rfc4180].
Double double-quotes are escape seq for double-quote in CSV format, see RFC 4180 [https://datatracker.ietf.org/doc/html/rfc4180].
thanks, didn't know that. LGTM than.
This needs somebody to manually test the change and then merge the PR.
@rhtyd I have tested as stated above. any particular tests scenario you want verified?
csv output processed by Writer from encoder/csv