osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue in parsing the strings in python code


Because the problem is every time when ever I see the output  using the
"nmcli c show", the below output is the weird output, so instead of
connecting to SSID "NIFunkloch" it randomly connects to "NIFunkloch 1552"
or sometimes to NIFunkloch 1000" or so on

root:~/qa/robot_tests# nmcli c show
NAME                UUID                                  TYPE      DEVICE

NIFunkloch 1552     c8e1e8c0-0f25-4299-a9ae-2910cfef2ebd  wifi      wlp1s0

Wired connection 1  2a14fbe6-58a0-3b7f-b986-5d1b36a94ec0  ethernet
enp0s21f0u4
NIFunkloch          1da7d068-4548-4446-bf88-a440e49db1b1  wifi      --

NIFunkloch 10       f4d9ce13-aab0-4485-9929-6070ad52a196  wifi      --

NIFunkloch 100      8b48a220-1754-4988-84ad-d0f83a9b4ede  wifi      --

NIFunkloch 1000     4dd7ae61-8c10-4582-984a-600b4c6b008e  wifi      --

NIFunkloch 1001     2fcd1d89-1d1c-43ca-8b6a-d667fa4b0f90  wifi      --

NIFunkloch 1002     c0a31697-afa9-453b-9938-811a9315e30f  wifi      --

NIFunkloch 1003     2dc7e148-d246-492f-94f0-88314fc0cc89  wifi      --

NIFunkloch 1004     a389f24e-ef39-4886-ae13-b38932e9f00d  wifi      --

NIFunkloch 1005     c2ecc4f5-58b8-4488-9769-f7c3fc044134  wifi      --

NIFunkloch 1006     de98d76c-22bf-4e1c-89fd-577538e8a40d  wifi      --

NIFunkloch 1007     0bca5d73-03e3-4bb4-a78c-98d0adabaac9  wifi      --

NIFunkloch 1008     dc576c25-75c8-491b-847a-8a192e6c3869  wifi      --

NIFunkloch 1009     46c8fc94-62d0-48d9-9fcb-489f646a9fbd  wifi      --

NIFunkloch 101      ce8a3276-016d-4101-8002-4092af9a49f3  wifi      --

NIFunkloch 1010     814716b2-935c-40a3-89a8-4bfebd9a7f6d  wifi      --

NIFunkloch 1011     68fa4889-63a3-41f2-b6e1-1be4982e756a  wifi      --

NIFunkloch 1012     c47d66ff-ea8c-498c-9c04-012732078923  wifi      --

NIFunkloch 1013     37b51561-f3eb-4162-a87e-7c37e495c30b  wifi      --

NIFunkloch 1014     ba9b30a5-c882-4e45-8882-3fe4cfcfd191  wifi      --

NIFunkloch 1015     9327e4d5-d5e5-4f3b-a70a-0eeec1d5256f  wifi      --

NIFunkloch 1016     e24c1a9a-1f5e-4895-9656-efed574dfae2  wifi      --

NIFunkloch 1017     1cf9c60f-9efd-474c-8dbc-804d9796764b  wifi      --

NIFunkloch 1018     ec678687-f8d4-4123-bf64-f8bf67523cb6  wifi      --

NIFunkloch 1019     655579c5-74ec-4d4b-a0bc-9d31a5f40658  wifi      --

NIFunkloch 102      1de1d876-37b2-40e7-9707-ced79ab2664a  wifi      --

NIFunkloch 1020     9e90cc37-76f2-482c-8932-3173d5f15594  wifi      --

NIFunkloch 1021     1529bc15-9baa-4ee6-9603-3613be98a3c8  wifi      --

NIFunkloch 1022     25f8279d-8100-4d8b-9571-4da7d3031977  wifi      --

NIFunkloch 1023     43c73d01-7921-4887-92be-4054186c8b44  wifi      --

NIFunkloch 1024     9f433dc9-fb07-4ad0-94c4-219e3f1dd429  wifi      --

NIFunkloch 1025     d3cba1d3-3c27-4711-874a-cbfdbdc41784  wifi      --

NIFunkloch 1026     066b02d6-760f-4dd1-826a-c210b20075db  wifi      --

NIFunkloch 1027     0f13c31b-3d4b-4b25-a3a1-6b88c6a46431  wifi      --

NIFunkloch 1028     904590e5-d7e2-4cb7-8507-9838cafa411e  wifi      --

NIFunkloch 1029     89aa5931-82e6-4475-b445-03729d03ffd8  wifi      --

NIFunkloch 103      028c7347-1933-4a26-8ff5-89fd8541c038  wifi      --

NIFunkloch 1030     ba0a681b-7022-4f7b-a684-889f8560bf19  wifi      --

NIFunkloch 1031     963bf13c-16e5-4b24-a71e-778b0b2ea4a8  wifi      --

NIFunkloch 1032     6c32f2a6-e68b-44ee-b1b4-ef413cd6d45b  wifi      --

NIFunkloch 1033     da463db4-56d2-4746-aae6-63680620f7de  wifi      --

NIFunkloch 1034     821412fc-0c67-4fd5-b126-63434043ae48  wifi      --

NIFunkloch 1035     fc6dfddf-2a4a-4477-b0fa-cd90a50f35a4  wifi      --

NIFunkloch 1036     b922fef5-3c71-40cd-bb82-bea31ec15657  wifi      --

NIFunkloch 1037     c4a2c4cb-3f31-494c-bf39-aa43cd9e5d29  wifi      --

NIFunkloch 1038     ceaff9ba-7fb6-4eb1-943a-99c282789279  wifi      --

NIFunkloch 1039     a9e790a6-b31e-4ff1-becf-78a61000a441  wifi      --

NIFunkloch 104      5f2199ed-371a-4a27-872b-c945d51926de  wifi      --

NIFunkloch 1040     4a84f94e-46bd-47d3-b7e3-5dcf9dc5f54a  wifi      --

NIFunkloch 1041     9d93fe6e-6a74-4744-8edf-09160fb3583f  wifi      --


On Mon, Nov 12, 2018 at 10:23 AM srinivasan <srinivasan.rns at gmail.com>
wrote:

> Hi Thomas,
>
> Great to hear from you, Could you please let me know how do I get the UUID
> "1da7d068-4548-4446-bf88-a440e49db1b1" by passing the name of the SSID
> "Funkloch' using "nmcli --terse" ??
>
> Many thanks in advance,
> Srini
>
> On Mon, Nov 12, 2018 at 9:59 AM Thomas Jollans <tjol at tjol.eu> wrote:
>
>> On 12/11/2018 09:28, srinivasan wrote:
>> > Dear Python Experts team,
>> >
>> > This question might be very simple for you, As am newbie to python,
>> could
>> > you please how to parse the below strings
>> >
>> > [snip]
>> >
>> >
>> > root:~/qa/robot_tests# nmcli c show
>>
>> Pro tip: many *nix tools have a flag that makes them produce
>> machine-readable output. E.g.: from the nmcli man page:
>>
>> OPTIONS
>>        -t | --terse
>>            Output is terse. This mode is designed and suitable for
>> computer (script) processing.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>