sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #06470
[Merge] ~ack/maas:drop-unused-scripts-contribs into maas:master
Alberto Donato has proposed merging ~ack/maas:drop-unused-scripts-contribs into maas:master.
Commit message:
drop some unused scripts/contrib files
They're not used anywhere not bundled in packages
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~ack/maas/+git/maas/+merge/439734
--
Your team MAAS Maintainers is requested to review the proposed merge of ~ack/maas:drop-unused-scripts-contribs into maas:master.
diff --git a/contrib/tgt.conf b/contrib/tgt.conf
deleted file mode 100644
index 1b5f332..0000000
--- a/contrib/tgt.conf
+++ /dev/null
@@ -1 +0,0 @@
-include /var/lib/maas/ephemeral/tgt.conf.d/*.conf
diff --git a/scripts/create-testing-certificates b/scripts/create-testing-certificates
deleted file mode 100755
index 1e26d6d..0000000
--- a/scripts/create-testing-certificates
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/usr/bin/env python3
-# -*- mode: python -*-
-# Copyright 2014-2016 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-"""Create example TLS certificates.
-
-``region.crt``, ``cluster.crt``, and ``trust.crt`` will be created in
-the current directory:
-
-* ``region.crt`` is a PEM-encoded self-signed certificate and key.
-
-* ``cluster.crt`` is a PEM-encoded certificate and key, signed by
- ``region.crt``.
-
-* ``trust.crt`` is the PEM-encoded certificate *not key* for the region.
-
-"""
-
-from datetime import timedelta
-from os import fchmod
-
-from twisted.internet import ssl
-
-
-def years_in_seconds(years):
- delta = timedelta(days=(years * 365))
- return int(delta.total_seconds())
-
-
-# Create the region key and self-signed certificate.
-region_key = ssl.KeyPair.generate(size=2048)
-region_cert = region_key.selfSignedCert(
- serialNumber=1, CN="MAAS Region *TESTING*")
-
-
-# Create a cluster key and a signing request.
-cluster_key = ssl.KeyPair.generate(size=2048)
-cluster_csr_data = cluster_key.certificateRequest(
- distinguishedName=ssl.DistinguishedName(CN="MAAS Cluster *TESTING*"))
-
-# Sign the request with the *region* key.
-cluster_cert_data = region_key.signCertificateRequest(
- issuerDistinguishedName=region_cert.getSubject(),
- requestData=cluster_csr_data, verifyDNCallback=(lambda dn: True),
- serialNumber=123, secondsToExpiry=years_in_seconds(5))
-
-# Load the cluster certificate from the signed certificate.
-cluster_cert = ssl.PrivateCertificate.load(
- data=cluster_cert_data, privateKey=cluster_key)
-
-
-def write_certificate(cert, filename):
- assert isinstance(cert, ssl.Certificate)
- # Save the certificate.
- with open(filename, "wb") as fout:
- fchmod(fout.fileno(), 0o600)
- fout.write(ssl.Certificate.dumpPEM(cert))
- # Check that the certificate can be loaded back in.
- with open(filename, "rb") as fin:
- cert_in = ssl.Certificate.loadPEM(fin.read())
- assert cert_in == cert
-
-
-def write_private_certificate(cert, filename):
- assert isinstance(cert, ssl.PrivateCertificate)
- # Save the certificate.
- with open(filename, "wb") as fout:
- fchmod(fout.fileno(), 0o600)
- fout.write(cert.dumpPEM())
- # Check that the certificate can be loaded back in.
- with open(filename, "rb") as fin:
- cert_in = ssl.PrivateCertificate.loadPEM(fin.read())
- assert cert_in == cert
-
-
-# Save the region certificate with its key.
-write_private_certificate(region_cert, "region.crt")
-
-# Save the region certificate on its own.
-write_certificate(ssl.Certificate(region_cert.original), "trust.crt")
-
-# Save the cluster certificate with its key.
-write_private_certificate(cluster_cert, "cluster.crt")
diff --git a/scripts/multicast-helper b/scripts/multicast-helper
deleted file mode 100755
index c1fc285..0000000
--- a/scripts/multicast-helper
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh -euf
-# Copyright 2017 Canonical Ltd. This software is licensed under the
-# GNU Affero General Public License version 3 (see the file LICENSE).
-
-# Helper script to join or leave MAAS-reserved multicast groups.
-# See the IANA registries for more information:
-# https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml
-# https://www.iana.org/assignments/ipv6-multicast-addresses/ipv6-multicast-addresses.xhtml
-
-IP="ip"
-
-# Note: The 'ip maddr add <mcast-address> dev <ifname>' command only supports
-# link-layer multicast addresses. Specifying an IPv4 address will not work.
-# This is the equivalent of "224.0.0.118".
-IPV4_GROUP="01:00:5e:00:00:76"
-
-# This is the equivalent of the MAAS variable-scope multicast group, and
-# corresponds to the link-local scoped group "ff02::15a".
-IPV6_GROUP="33:33:00:00:01:5a"
-
-usage()
-{
- echo "Usage: $0 <leave | join> [ifname...]" 1>&2
- echo " Attempts to join or leave the MAAS multicast groups." 1>&2
- echo " If no interfaces are specified, joins or leaves on all "`
- `"interfaces." 1>&2
-}
-
-if [ $# -lt 1 ]; then
- usage
- exit 1
-
-fi
-
-SUCCESSES=0
-FAILURES=""
-
-success()
-{
- SUCCESSES=$(($SUCCESSES+1))
- echo "$*"
-}
-
-join()
-{
- "$IP" maddr add "$IPV4_GROUP" dev "$1" 2> /dev/null && \
- success "$1: joined $IPV4_GROUP" || true
- "$IP" maddr add "$IPV6_GROUP" dev "$1" 2> /dev/null && \
- success "$1: joined $IPV6_GROUP" || true
-}
-
-leave()
-{
- "$IP" maddr del "$IPV4_GROUP" dev "$1" 2> /dev/null && \
- success "$1: left $IPV4_GROUP" || true
- "$IP" maddr del "$IPV6_GROUP" dev "$1" 2> /dev/null && \
- success "$1: left $IPV6_GROUP" || true
-}
-
-cmd="$1"
-shift
-
-if [ "$#" -eq 0 ]; then
- interfaces="$(ip maddr show | awk '/^[0-9]*:/ { print $2 }')"
-else
- interfaces="$*"
-fi
-
-
-if [ "$cmd" = "join" ]; then
- for ifname in $interfaces; do
- join "$ifname"
- done
-elif [ "$cmd" = "leave" ]; then
- for ifname in $interfaces; do
- leave "$ifname"
- done
-else
- usage
- exit 1
-fi
-
-if [ $SUCCESSES -eq 0 ]; then
- echo "$0: $cmd failed. (Try re-running with 'sudo'.)" 1>&2
- if [ "$cmd" = "leave" ]; then
- echo "(This is normal if no groups were joined to begin with.)" 1>&2
- fi
- exit 2
-fi
Follow ups