diff --git a/magnum_cluster_api/resources.py b/magnum_cluster_api/resources.py index 2073ae9a..42e0e172 100644 --- a/magnum_cluster_api/resources.py +++ b/magnum_cluster_api/resources.py @@ -1758,7 +1758,7 @@ def get_object(self) -> objects.ClusterClass: "path": "/spec/template/spec/kubeadmConfigSpec/preKubeadmCommands", "value": [ "systemctl daemon-reload", - "systemctl restart containerd" + "systemctl restart containerd", ], }, ], @@ -1839,7 +1839,7 @@ def get_object(self) -> objects.ClusterClass: "path": "/spec/template/spec/preKubeadmCommands", "value": [ "systemctl daemon-reload", - "systemctl restart containerd" + "systemctl restart containerd", ], }, ], diff --git a/magnum_cluster_api/utils.py b/magnum_cluster_api/utils.py index a331bc30..0b4e5e38 100644 --- a/magnum_cluster_api/utils.py +++ b/magnum_cluster_api/utils.py @@ -200,7 +200,10 @@ def generate_containerd_config( def generate_systemd_proxy_config(cluster: magnum_objects.Cluster): - if cluster.cluster_template.http_proxy != "" or cluster.cluster_template.https_proxy != "": + if ( + cluster.cluster_template.http_proxy != "" + or cluster.cluster_template.https_proxy != "" + ): return textwrap.dedent( """\ [Service] @@ -211,19 +214,29 @@ def generate_systemd_proxy_config(cluster: magnum_objects.Cluster): Environment="no_proxy={no_proxy}" Environment="NO_PROXY={no_proxy}" """ - ).format(http_proxy=cluster.cluster_template.http_proxy, https_proxy=cluster.cluster_template.https_proxy, no_proxy=cluster.cluster_template.no_proxy) + ).format( + http_proxy=cluster.cluster_template.http_proxy, + https_proxy=cluster.cluster_template.https_proxy, + no_proxy=cluster.cluster_template.no_proxy + ) else: return "" def generate_apt_proxy_config(cluster: magnum_objects.Cluster): - if cluster.cluster_template.http_proxy != "" or cluster.cluster_template.https_proxy != "": + if ( + cluster.cluster_template.http_proxy != "" + or cluster.cluster_template.https_proxy != "" + ): return textwrap.dedent( """\ Acquire::http::Proxy "{http_proxy}"; Acquire::https::Proxy "{https_proxy}"; """ - ).format(http_proxy=cluster.cluster_template.http_proxy, https_proxy=cluster.cluster_template.https_proxy) + ).format( + http_proxy=cluster.cluster_template.http_proxy, + https_proxy=cluster.cluster_template.https_proxy + ) else: return ""