pmcf 1.99.0 → 1.99.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": "1.99.0",
3
+ "version": "1.99.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/src/base.mjs CHANGED
@@ -239,8 +239,10 @@ export class Base {
239
239
 
240
240
  forOwner(owner) {
241
241
  if (this.owner !== owner) {
242
- // @ts-ignore
243
- return new this.constructor(owner, this.toJSON());
242
+ const newObject = Object.create(this);
243
+
244
+ newObject.owner = owner;
245
+ return newObject;
244
246
  }
245
247
 
246
248
  return this;
@@ -25,6 +25,11 @@ export async function generateNetworkDefs(host, packageData) {
25
25
  const networkDir = join(packageData.dir, "etc/systemd/network");
26
26
 
27
27
  for (const ni of host.networkInterfaces.values()) {
28
+ switch (ni.kind) {
29
+ case "loopback":
30
+ continue;
31
+ }
32
+
28
33
  if (ni.name !== "eth0" && ni.hwaddr) {
29
34
  await writeLines(networkDir, `${ni.name}.link`, [
30
35
  sectionLines("Match", { MACAddress: ni.hwaddr }),
@@ -46,7 +51,7 @@ export async function generateNetworkDefs(host, packageData) {
46
51
 
47
52
  switch (ni.kind) {
48
53
  case "ethernet":
49
- case "wifi":
54
+ case "wlan":
50
55
  const routeSectionExtra = ni.destination
51
56
  ? { Destination: ni.destination }
52
57
  : { Gateway: ni.gatewayAddress };
package/src/host.mjs CHANGED
@@ -501,17 +501,6 @@ export class NetworkInterface extends Base {
501
501
  this.read(data, NetworkInterfaceTypeDefinition);
502
502
  }
503
503
 
504
- forOwner(owner) {
505
- if (this.owner !== owner) {
506
- const data = { name: this.name };
507
-
508
- // @ts-ignore
509
- return new this.constructor(owner, data);
510
- }
511
-
512
- return this;
513
- }
514
-
515
504
  addSubnet(address) {
516
505
  if (!this.network) {
517
506
  if (!hasWellKnownSubnet(address)) {