pmcf 6.64.1 → 6.64.2

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.64.1",
3
+ "version": "6.64.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/cluster.mjs CHANGED
@@ -1,22 +1,25 @@
1
- import { duration_attribute_writable} from "pacc";
2
- import { host } from "./host.mjs";
3
-
1
+ import {
2
+ duration_attribute_writable,
3
+ default_collection_attribute_writable
4
+ } from "pacc";
4
5
  import { addType } from "./type.mjs";
5
- import { networkInterfaces_attribute } from "./common-attributes.mjs";
6
+ import { owner_attribute } from "./common-attributes.mjs";
7
+ import { host } from "./host.mjs";
6
8
 
7
9
  export class cluster extends host {
8
10
  static priority = 1.5;
9
11
  static attributes = {
10
12
  members: {
11
- ...networkInterfaces_attribute,
13
+ ...default_collection_attribute_writable,
14
+ type: "core",
15
+ backpointer: owner_attribute,
12
16
  name: "members"
13
17
  },
14
- checkInterval: {
15
- ...duration_attribute_writable,
16
- name: "checkInterval",
17
- default: 60
18
- },
19
-
18
+ checkInterval: {
19
+ ...duration_attribute_writable,
20
+ name: "checkInterval",
21
+ default: 60
22
+ }
20
23
  };
21
24
 
22
25
  static {
@@ -6,10 +6,10 @@ import {
6
6
  } from "pacc";
7
7
  import { FAMILY_IPV4 } from "ip-utilties";
8
8
  import { addType } from "../type.mjs";
9
+ import { PROTOCOL_TCP } from "../constants.mjs";
9
10
  import { core } from "../core.mjs";
10
11
  import { credential } from "../credential.mjs";
11
12
  import { CoreService, serviceEndpoints } from "../core-service.mjs";
12
- import { PROTOCOL_TCP } from "../constants.mjs";
13
13
 
14
14
  import { writeLines } from "../utils.mjs";
15
15
 
@@ -67,39 +67,39 @@ export class keepalived extends CoreService {
67
67
  addType(this);
68
68
  }
69
69
 
70
- clusters = new Map();
70
+ clusters = new Set();
71
71
  checkInterval = 60;
72
72
 
73
73
  async *preparePackages(dir) {
74
74
  const packageData = await this.preparePackage(dir);
75
75
 
76
- for (const clusterMember of this.clusters.values()) {
77
- const cluster = clusterMember.cluster;
78
- const host = cluster.host;
79
-
80
- const extra = [];
76
+ const extra = [];
81
77
 
82
- const smtp = this.smtp;
78
+ const smtp = this.smtp;
83
79
 
84
- if (smtp) {
85
- extra.push(` smtp_server ${smtp.address()}`);
86
- }
80
+ if (smtp) {
81
+ extra.push(` smtp_server ${smtp.address()}`);
82
+ }
87
83
 
88
- const cfg = [
89
- "global_defs {",
90
- " notification_email {",
91
- " " + this.administratorEmail,
92
- " }",
93
- ...extra,
94
- ` notification_email_from keepalived@${host.domainName}`,
95
- " enable_script_security",
96
- " script_user root",
97
- " max_auto_priority 20",
98
- "}",
99
- ""
100
- ];
84
+ const cfg = [
85
+ "global_defs {",
86
+ " notification_email {",
87
+ " " + this.administratorEmail,
88
+ " }",
89
+ ...extra,
90
+ ` notification_email_from keepalived@${this.domainName}`,
91
+ " enable_script_security",
92
+ " script_user root",
93
+ " max_auto_priority 20",
94
+ "}",
95
+ ""
96
+ ];
101
97
 
98
+ for (const clusterMember of this.clusters.values()) {
99
+ const cluster = clusterMember.cluster;
100
+ const host = cluster.host;
102
101
  const clusterName = cluster.name;
102
+
103
103
  cfg.push(`vrrp_instance ${clusterName} {`);
104
104
  cfg.push(` state ${clusterMember.role.toUpperCase()}`);
105
105