From nobody Tue Jun 10 09:33:23 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bGk9v45Yqz5tXHZ; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bGk9v3PTdz3Nd0; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ePn6a7bsU3ZE5xyOAEqaIPoDPza7jKcT5QcApvWNzq8=; b=LH89I1y/xPahm6XaMK+WCRMmEsHp+VUoSiNRXG7bJrsNy6rBXz8ug9AtBEsmxyhaAgDgt2 5QGcIzs3SDDEWvJfjZcG+De1079UmaB0SWRDLFyZqMYf4EKjVcDdDKsPty+sV/cCike9R9 cryObm1GqPxAML8r1Jw41k/Z4kd1+Obi479hni/f2yr6k2UqEL84hepN6zSJ4gMtUe4p26 fxB+ycWNaDAPljhyFjF6uk6Jb6udjdtkO8d0KLkdWY2rBvjbOplViZqcFbxa1uKgQoQ/kO zxoWGTETo+uxPQjB4EhSiHlDmi0f8+Jg98b0oa4FLFXEYlDF3OvXYxrftwci2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1749548003; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ePn6a7bsU3ZE5xyOAEqaIPoDPza7jKcT5QcApvWNzq8=; b=IJmvb9F6ZQ0WDpX3w3Fo1/x9EPqkLN9wExPBy0mRW8tBbgEIXHByzm1D+DWbImi4cKQRX5 dYdwPCk+s2TCxAnXkZbnhkry0ZU/F3i/xUZof0c0/bgen9uK0lFzi6ZN8cUHIQsERpK2fa XQXQYu+O1jd/LkuMDq7gAoa/g9TcMQf6rb21kBeW6N2NnxRwvJrXZ/36ZWcPGVaq2EAgN2 jX3RZZN5f0zce9LGk7MruNuG3GCJ38wxLbq0tOZMqrAtzXSt8Qu7q+9WdVeJgqSp133BUh FeHs2QLDRaax9prHmlBX1YSI98fYd4CozuZK9WbKWPaPI1aDK3G3XWEzd87erA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1749548003; a=rsa-sha256; cv=none; b=QmhkkWTXsorNBFYsYXOeazsLnGElj4rvTpQfYRnZWJCE7akzDD1xKzA7gzPFqvrej4K6HH YAbaL7ENlWQ552KnGtS32gallvCsrq4BtsTQIrdWDylMAN1zfYR1q8zrLXMhkYDyclR5ob zv3R/R6rhsKmEkpnhe+G4rK0zIs3oz8Xe08UOlzKVz1YaeSXgkeas2x3o3WZGlLQG1zw9o JCNtfDtdS5XLoSqeYRodm93xTzkl6nPKyL43TOtmuFz9RS0/PufFeptaIT+S5W3IKPhcDU jbVDiqzNjsZ1l6mquXdYDaGxnqLMlZSjojmEizOCruzvJBmGldgT35mC/t/DWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bGk9v2rvpzcFS; Tue, 10 Jun 2025 09:33:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55A9XNEA099062; Tue, 10 Jun 2025 09:33:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55A9XNaf099059; Tue, 10 Jun 2025 09:33:23 GMT (envelope-from git) Date: Tue, 10 Jun 2025 09:33:23 GMT Message-Id: <202506100933.55A9XNaf099059@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: f678c4759027 - main - nuageinit: pet luacheck List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f678c47590276aa8acdacdecfb78cc6c44bbf449 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=f678c47590276aa8acdacdecfb78cc6c44bbf449 commit f678c47590276aa8acdacdecfb78cc6c44bbf449 Author: Baptiste Daroussin AuthorDate: 2025-06-10 09:32:06 +0000 Commit: Baptiste Daroussin CommitDate: 2025-06-10 09:32:06 +0000 nuageinit: pet luacheck Rename path into ni_path (ni stands for nuageinit) which is more understandable and avoid a shadowing warning because we also use a variable named path later. Add a missing local --- libexec/nuageinit/nuageinit | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libexec/nuageinit/nuageinit b/libexec/nuageinit/nuageinit index cd5912c54975..c874f40b38a8 100755 --- a/libexec/nuageinit/nuageinit +++ b/libexec/nuageinit/nuageinit @@ -12,7 +12,7 @@ local sys_stat = require("posix.sys.stat") if #arg ~= 2 then nuage.err("Usage: " .. arg[0] .. " ( | )", false) end -local path = arg[1] +local ni_path = arg[1] local citype = arg[2] local default_user = { @@ -189,7 +189,7 @@ end if citype == "config-2" then local parser = ucl.parser() - local res, err = parser:parse_file(path .. "/meta_data.json") + local res, err = parser:parse_file(ni_path .. "/meta_data.json") if not res then nuage.err("error parsing config-2 meta_data.json: " .. err) @@ -204,9 +204,9 @@ if citype == "config-2" then nuage.sethostname(obj["hostname"]) -- network - config2_network(path) + config2_network(ni_path) elseif citype == "nocloud" then - local f, err = io.open(path .. "/meta-data") + local f, err = io.open(ni_path .. "/meta-data") if err then nuage.err("error parsing nocloud meta-data: " .. err) end @@ -229,9 +229,9 @@ end -- deal with user-data local ud = nil local f = nil -userdatas = {"user-data", "user_data"} +local userdatas = {"user-data", "user_data"} for _, v in pairs(userdatas) do - f = io.open(path .. "/" .. v, "r") + f = io.open(ni_path .. "/" .. v, "r") if f then ud = v break @@ -243,7 +243,7 @@ end local line = f:read("*l") f:close() if line == "#cloud-config" then - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local obj = yaml.eval(f:read("*a")) f:close() if not obj then @@ -405,7 +405,7 @@ if line == "#cloud-config" then end elseif line:sub(1, 2) == "#!" then -- delay for execution at rc.local time -- - f = io.open(path .. "/" .. ud) + f = io.open(ni_path .. "/" .. ud) local content = f:read("*a") f:close() nuage.mkdir_p(root .. "/var/cache/nuageinit")