🚨 linting fixes for prepare_deployment.py
This commit is contained in:
parent
96e88b00c1
commit
d4c2c2c747
1 changed files with 13 additions and 11 deletions
|
|
@ -18,9 +18,7 @@ def parse_args():
|
||||||
parser.add_argument("-a", "--address", required=True)
|
parser.add_argument("-a", "--address", required=True)
|
||||||
parser.add_argument("-i", "--interface", required=True)
|
parser.add_argument("-i", "--interface", required=True)
|
||||||
parser.add_argument("-m", "--netmask", default=24)
|
parser.add_argument("-m", "--netmask", default=24)
|
||||||
parser.add_argument(
|
parser.add_argument("-d", "--dns", nargs="+", action="append", required=True)
|
||||||
"-d", "--dns", nargs="+", action="append", required=True
|
|
||||||
)
|
|
||||||
parser.add_argument("-D", "--domain", default="aio")
|
parser.add_argument("-D", "--domain", default="aio")
|
||||||
parser.add_argument("--using-multiple-nics", action="store_true")
|
parser.add_argument("--using-multiple-nics", action="store_true")
|
||||||
parser.add_argument("-U", "--deployment-user")
|
parser.add_argument("-U", "--deployment-user")
|
||||||
|
|
@ -37,6 +35,11 @@ def parse_args():
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--deploy-script-out", default=f"{home}/deploy.sh.gen", dest="deploy"
|
"--deploy-script-out", default=f"{home}/deploy.sh.gen", dest="deploy"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--cinder-pool-size",
|
||||||
|
default="500280",
|
||||||
|
help="Size of the loopback device allocated to cinder. " "Defaults to 500280",
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
@ -69,6 +72,7 @@ def get_standalone_parameters(args):
|
||||||
"StandaloneEnableRoutedNetworks": False,
|
"StandaloneEnableRoutedNetworks": False,
|
||||||
"StandaloneHomeDir": args.deployment_dir,
|
"StandaloneHomeDir": args.deployment_dir,
|
||||||
"StandaloneLocalMtu": 1500,
|
"StandaloneLocalMtu": 1500,
|
||||||
|
"CinderLVMLoopDeviceSize": args.cinder_pool_size,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,22 +132,17 @@ def set_hostname(args):
|
||||||
print("set_hostname is not yet implemented")
|
print("set_hostname is not yet implemented")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""main function"""
|
"""main function"""
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|
||||||
containers_yaml = build_containers_yaml(args)
|
containers_yaml = build_containers_yaml(args)
|
||||||
with open(
|
with open(args.containers_yaml_out, "w", encoding="utf-8") as containers_out:
|
||||||
args.containers_yaml_out, "w", encoding="utf-8"
|
|
||||||
) as containers_out:
|
|
||||||
containers_out.write(yaml.dump(containers_yaml))
|
containers_out.write(yaml.dump(containers_yaml))
|
||||||
print(f"containers yaml written to {args.containers_yaml_out}")
|
print(f"containers yaml written to {args.containers_yaml_out}")
|
||||||
|
|
||||||
standalone_parameters = get_standalone_parameters(args)
|
standalone_parameters = get_standalone_parameters(args)
|
||||||
with open(
|
with open(args.standalone_yaml_out, "w", encoding="utf-8") as parameters_out:
|
||||||
args.standalone_yaml_out, "w", encoding="utf-8"
|
|
||||||
) as parameters_out:
|
|
||||||
parameters_out.write(yaml.dump(standalone_parameters))
|
parameters_out.write(yaml.dump(standalone_parameters))
|
||||||
print(f"standalone parameters yaml written to {args.standalone_yaml_out}")
|
print(f"standalone parameters yaml written to {args.standalone_yaml_out}")
|
||||||
|
|
||||||
|
|
@ -151,7 +150,10 @@ def main():
|
||||||
deploy.write(deploy_sh(args))
|
deploy.write(deploy_sh(args))
|
||||||
print(f"deploy script written to {args.deploy}")
|
print(f"deploy script written to {args.deploy}")
|
||||||
|
|
||||||
print("If you are running on a cloud image remenber to disable cloud-init before running the deploy.")
|
print(
|
||||||
|
"If you are running on a cloud image remenber to disable cloud-init "
|
||||||
|
"before running the deploy."
|
||||||
|
)
|
||||||
print("sudo systemctl stop cloud-init")
|
print("sudo systemctl stop cloud-init")
|
||||||
print("sudo systemctl disable cloud-init")
|
print("sudo systemctl disable cloud-init")
|
||||||
print("Make sure you have specifed the correct interface to use!")
|
print("Make sure you have specifed the correct interface to use!")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue