[Merge] ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel
Mitch Burton
mp+437634 at code.launchpad.net
Thu Feb 23 22:18:01 UTC 2023
Diff comments:
> diff --git a/debian/control b/debian/control
> index e6178c8..363cc76 100644
> --- a/debian/control
> +++ b/debian/control
> @@ -3,7 +3,7 @@ Section: admin
> Priority: optional
> Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
> XSBC-Original-Maintainer: Landscape Team <landscape-team at canonical.com>
> -Build-Depends: debhelper (>= 12), po-debconf, libdistro-info-perl,
> +Build-Depends: debhelper (>= 11), po-debconf, libdistro-info-perl,
In the interest of expedience, I will change it back to 12 with the intention to revisit this prior to any SRU and the applicability of the issues with 11.
> dh-python, python3-dev, python3-distutils-extra,
> lsb-release, gawk, net-tools,
> python3-apt, python3-twisted, python3-configobj
> diff --git a/landscape/client/monitor/ubuntuproinfo.py b/landscape/client/monitor/ubuntuproinfo.py
> new file mode 100644
> index 0000000..4f78999
> --- /dev/null
> +++ b/landscape/client/monitor/ubuntuproinfo.py
> @@ -0,0 +1,47 @@
> +import json
> +import subprocess
> +
> +from landscape.client.monitor.plugin import DataWatcher
> +
> +
> +class UbuntuProInfo(DataWatcher):
> + """
> + Plugin that captures and reports Ubuntu Pro registration
> + information.
> +
> + We use the `ua` CLI with output formatted as JSON. This is sent
> + as-is and parsed by Landscape Server because the JSON content is
> + considered "Experimental" and we don't want to have to change in
> + both Client and Server in the event that the format changes.
> + """
> +
> + run_interval = 900 # 15 minutes
> + message_type = "ubuntu-pro-info"
> + message_key = message_type
> + persist_name = message_type
> + scope = "ubuntu-pro"
> + run_immediately = True
> +
> + def get_data(self):
> + ubuntu_pro_info = get_ubuntu_pro_info()
> +
> + return json.dumps(ubuntu_pro_info, separators=(",", ":"))
> +
> +
> +def get_ubuntu_pro_info():
> + try:
> + completed_process = subprocess.run(
> + ["ua", "status", "--format", "json"],
> + encoding="utf8", stdout=subprocess.PIPE)
> + except FileNotFoundError:
> + return {
> + "errors": [{
> + "message": "ubuntu-advantage-tools not found.",
> + "message_code": "tools-error",
> + "service": None,
> + "type": "system",
> + }],
> + "result": "failure",
Your understanding is correct. I should produce a fix for this (and a renaming). If I do so, it should be using a d/patch right?
> + }
> + else:
> + return json.loads(completed_process.stdout)
--
https://code.launchpad.net/~mitchburton/ubuntu/+source/landscape-client/+git/landscape-client/+merge/437634
Your team Ubuntu Sponsors Team is requested to review the proposed merge of ~mitchburton/ubuntu/+source/landscape-client:ubuntu/lunar-devel into ubuntu/+source/landscape-client:ubuntu/lunar-devel.
More information about the Ubuntu-sponsors
mailing list