Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/136479/?format=api
https://patches.dpdk.org/api/patches/136479/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240207121641.22739-1-juraj.linkes@pantheon.tech/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240207121641.22739-1-juraj.linkes@pantheon.tech>", "list_archive_url": "https://inbox.dpdk.org/dev/20240207121641.22739-1-juraj.linkes@pantheon.tech", "date": "2024-02-07T12:16:41", "name": "[v1] dts: strip whitespaces from stdout and stderr", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "abcdaa7c773802bf76af7017607f99cdaa5f4f03", "submitter": { "id": 1626, "url": "https://patches.dpdk.org/api/people/1626/?format=api", "name": "Juraj Linkeš", "email": "juraj.linkes@pantheon.tech" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240207121641.22739-1-juraj.linkes@pantheon.tech/mbox/", "series": [ { "id": 31036, "url": "https://patches.dpdk.org/api/series/31036/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31036", "date": "2024-02-07T12:16:41", "name": "[v1] dts: strip whitespaces from stdout and stderr", "version": 1, "mbox": "https://patches.dpdk.org/series/31036/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/136479/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/136479/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8803443A46;\n\tWed, 7 Feb 2024 13:16:44 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 72ABE40279;\n\tWed, 7 Feb 2024 13:16:44 +0100 (CET)", "from mail-lf1-f49.google.com (mail-lf1-f49.google.com\n [209.85.167.49]) by mails.dpdk.org (Postfix) with ESMTP id 3487E4026E\n for <dev@dpdk.org>; Wed, 7 Feb 2024 13:16:43 +0100 (CET)", "by mail-lf1-f49.google.com with SMTP id\n 2adb3069b0e04-51032058f17so667063e87.3\n for <dev@dpdk.org>; Wed, 07 Feb 2024 04:16:43 -0800 (PST)", "from jlinkes-PT-Latitude-5530.pantheon.local\n (81.89.53.154.host.vnet.sk. [81.89.53.154])\n by smtp.gmail.com with ESMTPSA id\n cu9-20020a170906ba8900b00a381bcf7bdcsm700341ejd.142.2024.02.07.04.16.42\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 07 Feb 2024 04:16:42 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=pantheon.tech; s=google; t=1707308202; x=1707913002; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=nmtqDPY6klTHRtvZ4ON5zokL5K7hPtEIHMVcFCqqW5w=;\n b=MfExZ3k9O+jqELvFyW/1eGVt7u+WILmumBom0ZhqlRJPZbm+SlWoTfsnxiYlBGBk+M\n JrraH+phCdGNkJ335YTG3tVtoC/+LPjdZduX7A6TIZInBWtac1/Wzy2pE2cH+7QhS/8m\n t8q1/VzMpMn91pmtYl/2kq2SDtsArmYKqhYg5U1e18vKId2h+k7ay5VMeaBAvF3vgeUG\n KZJ5aP9W7j0cTTOyNuGJ4e4RCEyphJCB3Yj1DCdYraCQDwI43JkBP4H1UhNEws7HS+BF\n zT/hyJxAhmU/SVo+yymF4Mu/gimvtwnL/ThBOjy5fkWtUoinewrdMokuDTH53plDI09i\n FoKw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1707308202; x=1707913002;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=nmtqDPY6klTHRtvZ4ON5zokL5K7hPtEIHMVcFCqqW5w=;\n b=YtIHZ5p5XdxranJ9hqzmJNzjPYh3sjf4PZIuPs/o47i7krKTPyxUFVhMjNtwT87dy7\n jNBsJN87NGWqIJ1/chPVJYfIaLQNfvyagsHcY4lJ9k7HahsSF1Z5DwPp/Uhc0MUzguq9\n colCae76rXk4zlve1CQ8QVi/06mZU8XtrYvaOEOSR7eaqDCxe/YRH1Ss1nDG8sTkUTbG\n ciMGJ4nBW/5y5Voz7dgep9I0ZhLHMnFmbT0dsDg+19a/Gv9fpamyxnd6DBdgrbiiJHQD\n bhZ7ri0CvrzmSPgr7GePF68m8WCyyYR85k8r3+rD2U5xShOwmhChgcH/fEIY1SyLwZ8p\n yUFw==", "X-Gm-Message-State": "AOJu0YxLsKyN7MfhqLRsSEhtoUKuXA2MOve16ADIHYctDV5QVMcRq6Pn\n VnBremEzHiJCVx0X1BmzrkcNwMPNTksHycNeFewDU7I2/DgfyPvGlCtSW9xzyv8=", "X-Google-Smtp-Source": "\n AGHT+IHqNrSceYIOwXuJ2pVrmIW7RpvR4Zoy3RWk10QTys33iEoL+TnSkzxFR3BcY3sY4D3oHjc2nw==", "X-Received": "by 2002:a05:6512:33cb:b0:511:499d:5ab6 with SMTP id\n d11-20020a05651233cb00b00511499d5ab6mr5361233lfg.14.1707308202633;\n Wed, 07 Feb 2024 04:16:42 -0800 (PST)", "X-Forwarded-Encrypted": "i=1;\n AJvYcCVmQw2+HJUwDby2P076j4z74TZh04c40aDCOXmqxMrAVGv86DNQVMB/ixLNeryAK4IwVpJ29g+AbrCRhBErqml1q0fg8SWE89OKTNrQuiFnPJQmQGcKUJ5ed21Emvx/6m0u7NelUC4Mk2pL6U/BUKyicwuXvtoGKp5WFppOkHnj7ciGUTKj6EX2sDZf7jf8HjrbUvWJWiZuaC52Xlt0rBtx87Kh/rwbDyZSxKQr4xEuwSyCOVhRM2hl3s2SEzfLwIHN", "From": "=?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "To": "thomas@monjalon.net, Honnappa.Nagarahalli@arm.com, jspewock@iol.unh.edu,\n probb@iol.unh.edu, paul.szczepanek@arm.com, Luca.Vizzarro@arm.com", "Cc": "dev@dpdk.org, =?utf-8?q?Juraj_Linke=C5=A1?= <juraj.linkes@pantheon.tech>", "Subject": "[PATCH v1] dts: strip whitespaces from stdout and stderr", "Date": "Wed, 7 Feb 2024 13:16:41 +0100", "Message-Id": "<20240207121641.22739-1-juraj.linkes@pantheon.tech>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "There could be a newline at the end of stdout or stderr of a remotely\nexecuted command. These cause issues when used later, such as when\njoining paths from such commands - a newline in the middle of a path is\nnot valid.\n\nFixes: ad80f550dbc5 (\"dts: add SSH command verification\")\nSigned-off-by: Juraj Linkeš <juraj.linkes@pantheon.tech>\n---\n .../remote_session/remote_session.py | 24 +++++++++++++++----\n 1 file changed, 20 insertions(+), 4 deletions(-)", "diff": "diff --git a/dts/framework/remote_session/remote_session.py b/dts/framework/remote_session/remote_session.py\nindex 2059f9a981..6bea1a2306 100644\n--- a/dts/framework/remote_session/remote_session.py\n+++ b/dts/framework/remote_session/remote_session.py\n@@ -10,8 +10,8 @@\n \"\"\"\n \n \n-import dataclasses\n from abc import ABC, abstractmethod\n+from dataclasses import InitVar, dataclass, field\n from pathlib import PurePath\n \n from framework.config import NodeConfiguration\n@@ -20,7 +20,7 @@\n from framework.settings import SETTINGS\n \n \n-@dataclasses.dataclass(slots=True, frozen=True)\n+@dataclass(slots=True, frozen=True)\n class CommandResult:\n \"\"\"The result of remote execution of a command.\n \n@@ -34,9 +34,25 @@ class CommandResult:\n \n name: str\n command: str\n- stdout: str\n- stderr: str\n+ init_stdout: InitVar[str]\n+ init_stderr: InitVar[str]\n return_code: int\n+ stdout: str = field(init=False)\n+ stderr: str = field(init=False)\n+\n+ def __post_init__(self, init_stdout, init_stderr):\n+ \"\"\"Strip the whitespaces from stdout and stderr.\n+\n+ The generated __init__ method uses object.__setattr__() when the dataclass is frozen,\n+ so that's what we use here as well.\n+\n+ In order to get access to dataclass fields in the __post_init__ method,\n+ we have to type them as InitVars. These InitVars are included in the __init__ method's\n+ signature, so we have to exclude the actual stdout and stderr fields\n+ from the __init__ method's signature, so that we have the proper number of arguments.\n+ \"\"\"\n+ object.__setattr__(self, \"stdout\", init_stdout.strip())\n+ object.__setattr__(self, \"stderr\", init_stderr.strip())\n \n def __str__(self) -> str:\n \"\"\"Format the command outputs.\"\"\"\n", "prefixes": [ "v1" ] }{ "id": 136479, "url": "