pmcf 6.60.1 → 6.60.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcf",
3
- "version": "6.60.1",
3
+ "version": "6.60.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -109,7 +109,7 @@ export class CoreService extends base {
109
109
  }
110
110
 
111
111
  get credentials() {
112
- return this.mapFromDirections(["this", "extends"], "_credentials")
112
+ return this.mapFromDirections(["this", "extends"], "_credentials");
113
113
  }
114
114
 
115
115
  get network() {
@@ -289,7 +289,6 @@ export class CoreService extends base {
289
289
  const seen = new Set();
290
290
 
291
291
  for (const [name, cred] of this.credentials) {
292
- //console.log(this.fullName,name);
293
292
  if (cred.systemdCredential && !seen.has(name)) {
294
293
  seen.add(name);
295
294
  lines.push(
@@ -300,8 +299,9 @@ export class CoreService extends base {
300
299
 
301
300
  if (lines.length) {
302
301
  await writeLines(
303
- join(dir, `etc/systemd/system/${name}.service.d`),
302
+ join(dir, `etc/systemd/system/${name}.d`),
304
303
  `credentials.conf`,
304
+ "[Service]",
305
305
  lines
306
306
  );
307
307
  }
@@ -470,8 +470,8 @@ export class kea extends CoreService {
470
470
 
471
471
  const packageData = await this.preparePackage(dir);
472
472
 
473
- await this.writeSystemdCredentialConfig(dir, "kea-dhcp4");
474
- await this.writeSystemdCredentialConfig(dir, "kea-dhcp6");
473
+ await this.writeSystemdCredentialConfig(dir, "kea-dhcp4.service");
474
+ await this.writeSystemdCredentialConfig(dir, "kea-dhcp6.service");
475
475
 
476
476
  for (const [name, data] of Object.entries({
477
477
  "kea-dhcp-ddns": ddns,
package/src/utils.mjs CHANGED
@@ -35,24 +35,13 @@ export function domainFromDominName(domainName, defaultDomain) {
35
35
  return defaultDomain;
36
36
  }
37
37
 
38
- export async function writeLines(dir, name, lines) {
39
- let data;
40
-
41
- switch (typeof lines) {
42
- case "undefined":
43
- return;
44
- case "string":
45
- data = lines;
46
- break;
47
-
48
- default:
49
- data = [...lines]
38
+ export async function writeLines(dir, name, ...lines) {
39
+ const data = lines
50
40
  .flat()
51
41
  .filter(line => line !== undefined)
52
42
  .map(l => l + "\n")
53
43
  .join("");
54
- }
55
-
44
+
56
45
  const full = join(dir, name);
57
46
  dir = dirname(full);
58
47
  name = basename(full);