kcli 99.0.202510231949__py3-none-any.whl → 99.0.202511270652__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kcli
3
- Version: 99.0.202510231949
3
+ Version: 99.0.202511270652
4
4
  Summary: Provisioner/Manager for Libvirt/Vsphere/Aws/Gcp/Hcloud/Kubevirt/Ovirt/Openstack/IBM Cloud and containers
5
5
  Home-page: http://github.com/karmab/kcli
6
6
  Author: Karim Boumedhel
@@ -1,9 +1,9 @@
1
- kcli-99.0.202510231949.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
1
+ kcli-99.0.202511270652.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
2
2
  kvirt/__init__.py,sha256=eoZ6GfifbqhMLNzjlqRDVil-yyBkOmVN9ujSgJWNBlY,15
3
3
  kvirt/baseconfig.py,sha256=QG_AHI1_HAgHwIdZSm1BXkpn9pW35kTMUkFOb7UE_wY,83513
4
4
  kvirt/bottle.py,sha256=K24aCQYSylDpkxmLYGygSpAJ4MlMqMk85AMpbCWA43c,175729
5
5
  kvirt/cli.py,sha256=D1lMERW5zuH6H7vzJHIX2UIdcpv16V2CaV-Ear3UTC8,265483
6
- kvirt/config.py,sha256=ikO03beELPo1o08-Aa-S1OgxdufvTDXMsaY828R7NgI,184294
6
+ kvirt/config.py,sha256=TSCS6pjt85nKY6TpL7yfPUF64zFbI1_xYAZYtj3Jfc8,184488
7
7
  kvirt/containerconfig.py,sha256=qbvOWwFlyU2F-4rZn9PLj97wDnSBIwAYA6Xlxr13OOc,2329
8
8
  kvirt/defaults.py,sha256=n55lnshkM6oXJPcolMvCo8Tjz9xdBGO8nGI1ejQJzvc,12212
9
9
  kvirt/ekstoken.py,sha256=MjK_tcLFl2VKxqgTSB4ve_kybZw5dBj2H6BezGGtBpM,1475
@@ -11,7 +11,7 @@ kvirt/examples.py,sha256=KTiMRjXHpwoEg5fPgndDADa15LKV79aT6Ty2ihu8wI4,28876
11
11
  kvirt/gketoken.py,sha256=up6cyslRTsoOHu9xT8fa0chES6RWExIu0IzXQY0IxQs,934
12
12
  kvirt/keywords.yaml,sha256=HVg-130j21WWuDrSvaGI98xLwLDiMwUsU3oAnRUm2Ls,10145
13
13
  kvirt/klist.py,sha256=TT6j6_gHUgSIkTsrDnTvNMdgrdpgOUJZbJp9xPyq5ns,3395
14
- kvirt/kmcp.py,sha256=Wyfx2BmRryphCl29Bs37EL4suVwpoorb5IJunbty3HU,26172
14
+ kvirt/kmcp.py,sha256=1zKdMGkcNjNr8detyKaUmiSyCRxg3kr-bfmrJ6aSaSc,29612
15
15
  kvirt/cluster/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  kvirt/cluster/sampleprovider.py,sha256=6K-rh95Os9yMOTzGp9afiQeWhDE2Y2KEc0TjnpFY3xs,181
17
17
  kvirt/cluster/aks/__init__.py,sha256=I-e-MwzLEaOtuS_xPdY4rIO_Wey2M9o9-VX5ETgxlQM,8967
@@ -81,7 +81,7 @@ kvirt/cluster/kubeadm/disconnected.yml,sha256=ntIU2kPXJfDJiW9b2aip4QdmricDTUxzZ6
81
81
  kvirt/cluster/kubeadm/join.sh,sha256=JIkMmRDlCzi-MshamKizHUiJCSzshvESjo9inN47ItA,267
82
82
  kvirt/cluster/kubeadm/kcli_default.yml,sha256=4vO3t2kGHkzmoU4hILyBum08Yxh4a8n7aO785B4zflU,2449
83
83
  kvirt/cluster/kubeadm/keepalived.conf,sha256=OwQ_PozqBMzAULPjjJ2TbAHK3n9BE5gyCqkqZ0SFmic,588
84
- kvirt/cluster/kubeadm/keepalived.sh,sha256=QMLjKiVtOa4S4-zBEnXWOoN8a6-FhNxKbSgovw-koOg,424
84
+ kvirt/cluster/kubeadm/keepalived.sh,sha256=D4oRKdrjHPERIFc3N8y75vWoDyLeNj1xk1WCVFEpm8Y,470
85
85
  kvirt/cluster/kubeadm/nfs.sh,sha256=g_8yPIpKedLwiXJ9FkMC2R6pCANSMX8SVWk-WDML1vY,1769
86
86
  kvirt/cluster/kubeadm/nfs.yml,sha256=js0KtTYqI1dtnc018wBXefyVPsCVn_sSneShMCJWUe4,226
87
87
  kvirt/cluster/kubeadm/pre_el.sh,sha256=5x1yZ_05EAJVE2TYLm_4beNX-Cc57QNUFuqpbS6tN78,2008
@@ -146,7 +146,7 @@ kvirt/cluster/kubeadm/disconnected/scripts/05_web.sh,sha256=Rx8HcXlZUS4BAGZaz9Xz
146
146
  kvirt/cluster/kubeadm/disconnected/scripts/deploy.sh,sha256=rN9whVEGPzAc-3WwQjLF0tSb976bsXv8ol1lSCD709s,593
147
147
  kvirt/cluster/kubernetes/__init__.py,sha256=3-Y_L5eSKmPjorrpjyhyaKT-eyB9KmbF80y2zdONCls,9287
148
148
  kvirt/cluster/microshift/__init__.py,sha256=4yzu0ZNyczYomhxy23vWgVJBr88y4OYmkSq915NA_OY,4319
149
- kvirt/cluster/microshift/kcli_default.yml,sha256=-zFf6SfiXDZihhjaNmuuiFlKfuVKUpadyMhTIwPoIdg,635
149
+ kvirt/cluster/microshift/kcli_default.yml,sha256=lEgp7QcerTmRc0V-rsGBNj0AVAbjadd3atNmBRpZFEE,635
150
150
  kvirt/cluster/microshift/kcli_plan.yml,sha256=DKqw0smtF0eBRYegUbXFgEH1RYihRRq-P9-_T3cZsJg,571
151
151
  kvirt/cluster/microshift/scripts/00_sslip.sh,sha256=sD2d5PwNGEw5hEr65O8DGJK282cy-TLG_aLWRXLnueE,262
152
152
  kvirt/cluster/microshift/scripts/01_clients.sh,sha256=wsgvmssSfGrH4W9RjcInwkUWr7pORN3JXI8avaq1Fj0,1100
@@ -164,7 +164,7 @@ kvirt/cluster/openshift/99-autologin.yaml,sha256=qkOEEfsuH4S-ptZ6sWY-GnaKzBM_EYt
164
164
  kvirt/cluster/openshift/99-bootstrap-deletion-2.yaml,sha256=dq-jBNqBfuPH0HCXsql3ZP6gOawapYzWr7_TRqMSRZo,616
165
165
  kvirt/cluster/openshift/99-bootstrap-deletion.yaml,sha256=7AdtAtSsrI0OeuNe68eY8QkAEgYJEeClhNxQnl3hVGI,1237
166
166
  kvirt/cluster/openshift/99-chrony.yaml,sha256=NxNx35-nrEBdT83Rw0y8Pl-C4prknGtiGbT6EGkchkM,529
167
- kvirt/cluster/openshift/99-kcli-forcedns,sha256=meMfjHRDP8d0clIkZk6HAMnF615IQZWd3aPps_s4ELc,961
167
+ kvirt/cluster/openshift/99-kcli-forcedns,sha256=WKWiT4De-N9sC5DWSlZ1flWSC9NuNNWHOAJVL5GEHWg,800
168
168
  kvirt/cluster/openshift/99-kcli-forcedns-ibm,sha256=F65o8Au2PmfapeXdS-t-CTURkrVmOvlAA-6xdgsd0bc,476
169
169
  kvirt/cluster/openshift/99-kubevirt-fix.yaml,sha256=A8hyix2InQAkZeD1UEjWS0jCd_Ih8e_2rDKuUaz3Gug,854
170
170
  kvirt/cluster/openshift/99-metal3-fake-machine.yaml,sha256=Bm1h00oD0PACNHk1QQJf-kfHQHD7f4VOkGRCQ9rfSUI,250
@@ -176,7 +176,7 @@ kvirt/cluster/openshift/99-ovn.yaml,sha256=cdEJWIVdFsaYLWtp5_v3TSI0sFTzYZvo2Euaj
176
176
  kvirt/cluster/openshift/99-prega-catalog.yaml,sha256=kRRCkq7joALdpeZlOL4zXvtZod6XRnk_mBgE7rTWxLA,313
177
177
  kvirt/cluster/openshift/99-sno.yaml,sha256=JFxdhvChu1o29fOzDyfuU-jtcfcLXd7G7YAt8y9HGU8,488
178
178
  kvirt/cluster/openshift/Corefile,sha256=lSF1OmirH2vyxO9qNItWzYLp-sLYF4z5liAX6LjTRkw,792
179
- kvirt/cluster/openshift/__init__.py,sha256=mfbTcrMzTPmS5X6EMhwp7uESGBI74yZMZ0kH668MyW8,96394
179
+ kvirt/cluster/openshift/__init__.py,sha256=dYgPCFHleNfRAxohfdptFn_VBFb8uw-CUG25Mu7dF1c,96599
180
180
  kvirt/cluster/openshift/autoapprovercron.yml,sha256=vR2IRwjNpu4rQDy3H_EDSt3Is0o7A7CIo_zbqcEv8ww,1324
181
181
  kvirt/cluster/openshift/autorules.yml,sha256=j0WEdUDUDbQrnMGEZXFRe3vNz2JQLNaDr_EjaucgAu8,985
182
182
  kvirt/cluster/openshift/bgp-vip.sh,sha256=e70UJTxb7H_mWK1Zi7ofHV2ISqWZYfpOG0tArtn8Dvo,459
@@ -285,11 +285,11 @@ kvirt/cluster/openshift/customisation/99-iptables.yaml,sha256=Ky_607MS_UEuTrRW65
285
285
  kvirt/cluster/openshift/customisation/99-monitoring.yaml,sha256=baO_U_-tLG2w_QmBsnarLe58m3v3KW2CWoFg0CsdR5Y,184
286
286
  kvirt/cluster/openshift/customisation/99-registry.yaml,sha256=dgzvUvHbuboyQDgyjpIpZn3I_rSPZG56YmwnIAJ9wzs,289
287
287
  kvirt/cluster/openshift/disconnected/haproxy.cfg,sha256=UJLex4syWzKSmg4KUrskCCO-OV28igksgAv8-EVOWi0,1364
288
- kvirt/cluster/openshift/disconnected/mirror-config.yaml,sha256=bjcPl3uadIEx7JaWHWkV_Xek3upLxZRI0_G5SGdOg7k,5745
288
+ kvirt/cluster/openshift/disconnected/mirror-config.yaml,sha256=ImEEsA-gnECwXiLFDXhCNrByG_mj_4WRUXHjY4dBqA0,5723
289
289
  kvirt/cluster/openshift/disconnected/registry.service,sha256=Mc0KDlmifNt_SbTGVUj3QLtKZs6LPIk-GOtVjZkyQHY,211
290
290
  kvirt/cluster/openshift/disconnected/bin/sync_image.sh,sha256=U2Q28q3aO8B4PHN8AzFg_rJZZAnLPWCaZfJX_3yQvLs,328
291
- kvirt/cluster/openshift/disconnected/scripts/01_packages.sh,sha256=OGx16d343Q_HIkBu0kGjbwMCSnlLwheROAeHgtXuwbE,394
292
- kvirt/cluster/openshift/disconnected/scripts/02_registry.sh,sha256=tVaue72Tr71jVzTdcgyam0CqhMUQs-rqEuuJLJ6SYAU,2084
291
+ kvirt/cluster/openshift/disconnected/scripts/01_packages.sh,sha256=sjGySdrNZofXseslvvKzTSVRBtaRGQxMKpROIrLJfWI,404
292
+ kvirt/cluster/openshift/disconnected/scripts/02_registry.sh,sha256=EEBfy3NrLuuQ6NCjnWEoBEvIRL0xC-NmTUp-wQJdVmg,2099
293
293
  kvirt/cluster/openshift/disconnected/scripts/03_mirror.sh,sha256=F_a_ZWS-ulBO2wQOqSrfcPHFMa_4_GjBwf_bBspfMbo,3472
294
294
  kvirt/cluster/openshift/disconnected/scripts/04_web.sh,sha256=CYwycblPOu5f4hdAe83ZTde2ZeWkGb8CnNPR95SKy_U,197
295
295
  kvirt/cluster/openshift/disconnected/scripts/deploy.sh,sha256=fTRiycD9xQQAPTExH3kD3jqmwha_rA_nBEdjeRnIXmk,491
@@ -390,10 +390,10 @@ kvirt/providers/fake/__init__.py,sha256=TYJe0iwO0Y7QrksKx4E63-Lxgc6WYNcjAHAq_Lwh
390
390
  kvirt/providers/gcp/__init__.py,sha256=_8qln7pO0_3MSmZ1P4X-THlTbbwFuR_a4wVCCeL0WSI,102731
391
391
  kvirt/providers/gcp/gcp-hack.service,sha256=gG35O6KTLlGqIMwrSBqb_id-h3SWm_us_yLkLfQelOw,175
392
392
  kvirt/providers/gcp/gcp-hack.sh,sha256=kH051zNphRtJe-eVi8CX28_mxP6ID1f3pSTDzvE9XzE,220
393
- kvirt/providers/hcloud/__init__.py,sha256=CPf6L2pEMIGnAVVdt4fczjj2tlJmSkL0eSLoqC9-biE,22728
393
+ kvirt/providers/hcloud/__init__.py,sha256=EO-yv-DBEjVwqeKt2xIN_As4k6teW0u3j1SoA4jY7UQ,22773
394
394
  kvirt/providers/ibm/__init__.py,sha256=OTGDRCwvvOZCTNGD_QXx52-9_tsBzA7Y079RAo9XL9M,66129
395
395
  kvirt/providers/kubevirt/__init__.py,sha256=x65aC-YxsjIVNuUxkvBcbvvMJbm8za7XNg2huogel1I,94583
396
- kvirt/providers/kvm/__init__.py,sha256=p1pTEUXOW1n5Qcj4qfQduGCVXYGd_PyhDuMVPknWMXs,195388
396
+ kvirt/providers/kvm/__init__.py,sha256=cVhFpNF4MINR6jx-zfrAdL5e_sKV-oWuz8Atni2sYqI,195364
397
397
  kvirt/providers/kvm/helpers.py,sha256=t2CLczaU-gWPXL6iglK2Mlu-85ErH59nkdSA50v18lM,1965
398
398
  kvirt/providers/openstack/__init__.py,sha256=T8gGmgzF0JlzsHUHEKCOUGHW5KWfFPXig6lOvYeGeUU,60117
399
399
  kvirt/providers/ovirt/__init__.py,sha256=2qVEM3JsFnNm2gvTLRNdru5GZBwnQ7AzYSXyPdDGlT8,64383
@@ -403,7 +403,7 @@ kvirt/providers/vsphere/helpers.py,sha256=eJnwVGdWArTurH5ckzScvLThNJaMWeakdxBbDT
403
403
  kvirt/providers/vsphere/tagging.py,sha256=7RqFIUETSzHAjS0F_8-j145-_8lca7aDUsCxs4DhQVQ,4893
404
404
  kvirt/providers/web/__init__.py,sha256=_9fv0_x5VomFrMZqTsMLHkIRkvujmFgTxggtRctvMD0,22053
405
405
  kvirt/version/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
406
- kvirt/version/git,sha256=nWfHrjMe4fMFyHlScreoSeOWhGKTV-NgWCjHUzLa-yU,19
406
+ kvirt/version/git,sha256=HWQvPCluXhzSJ7vEbM0SSIrhr7m5-o8gKk2xXmSdIUU,19
407
407
  kvirt/web/__init__.py,sha256=QW-FVaQGYogXwgV2g4f0J9s0QqUI6qIyX1ruRaiI8Yk,46658
408
408
  kvirt/web/main.py,sha256=DIb6tW3ce7wCc83kD9HBCG4ALJuLItp9uaP6tzdsm_Y,261
409
409
  kvirt/web/static/css/bootstrap-notify.css,sha256=ibUTW-jDj-F8d1T1KZ4DOujRmVTFfvMKL9y14QgEaPQ,408
@@ -645,8 +645,8 @@ kvirt/web/templates/vmprofiles.html,sha256=T65Cv7povhBtD2dyuWkWJE6byaA9EYtLSk5gt
645
645
  kvirt/web/templates/vmprofilestable.html,sha256=-8viNOqSvN_yzimENxq7Q0187zbflOn8p8zpgx0Vyek,1420
646
646
  kvirt/web/templates/vms.html,sha256=k2ptKeiLFdpzgfbk6xi__sduu0UALYXXrnrmDEmAfaQ,470
647
647
  kvirt/web/templates/vmstable.html,sha256=ikuYkIm_ocvGIBXFyJt1-tBjwQWCyqkgC08leoXgR54,4894
648
- kcli-99.0.202510231949.dist-info/METADATA,sha256=S2iGo-18JOWBdfZHkE85rMV1pugI-TVYu87_mu04yyM,4645
649
- kcli-99.0.202510231949.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
650
- kcli-99.0.202510231949.dist-info/entry_points.txt,sha256=i2SGYxlDWWeD6Nn0QBRT2kZ7uA4pmvVU5CunMeQ3zfA,207
651
- kcli-99.0.202510231949.dist-info/top_level.txt,sha256=FwVTxtMIWdr8QBk5mTfd0f_GheFlRR_vn4zl6p5N57s,6
652
- kcli-99.0.202510231949.dist-info/RECORD,,
648
+ kcli-99.0.202511270652.dist-info/METADATA,sha256=1zIabsjW3PVuQ_2qEE3GA8Sp3cYZyzYzNEIlX1CGm0Y,4645
649
+ kcli-99.0.202511270652.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
650
+ kcli-99.0.202511270652.dist-info/entry_points.txt,sha256=e5EB5e2acrwl3_sYA0GrjE42UMcMfiijMJqXb6TZRmQ,245
651
+ kcli-99.0.202511270652.dist-info/top_level.txt,sha256=FwVTxtMIWdr8QBk5mTfd0f_GheFlRR_vn4zl6p5N57s,6
652
+ kcli-99.0.202511270652.dist-info/RECORD,,
@@ -2,7 +2,8 @@
2
2
  ekstoken = kvirt.ekstoken:cli
3
3
  gketoken = kvirt.gketoken:cli
4
4
  kcli = kvirt.cli:cli
5
+ kcliagent = kvirt.agent.agent:main
6
+ kclimcp = kvirt.kmcp:main
5
7
  klist.py = kvirt.klist:main
6
- kmcp = kvirt.kmcp:main
7
8
  ksushy = kvirt.ksushy.main:run
8
9
  kweb = kvirt.web.main:run
@@ -2,7 +2,7 @@ PKGMGR="{{ 'apt-get' if ubuntu else 'dnf' }}"
2
2
  $PKGMGR -y install keepalived
3
3
  NETMASK=$(ip -o -f inet addr show | awk '/scope global/ {print $4}' | head -1 | cut -d'/' -f2)
4
4
  sed -i "s/NETMASK/$NETMASK/" /root/keepalived.conf
5
- NIC=$(find /sys/class/net -type l -not -lname '*virtual*' -printf '%f\n' | head -1)
5
+ NIC=$(awk '/default/ {for(i=1;i<=NF;i++) if($i=="dev") {print $(i+1); exit}}' <(ip route show default; ip -6 route show default))
6
6
  sed -i "s/NIC/$NIC/" /root/keepalived.conf
7
7
  cp /root/keepalived.conf /etc/keepalived
8
8
  systemctl enable --now keepalived
@@ -5,7 +5,7 @@ info: |
5
5
  cluster: mymicroshift
6
6
  domain: karmalabs.corp
7
7
  version: stable
8
- tag: '4.16'
8
+ tag: '4.20'
9
9
  image: rhel9
10
10
  network: default
11
11
  memory: 4096
@@ -1,21 +1,18 @@
1
1
  #!/bin/bash
2
2
 
3
- which crictl >/dev/null 2>&1
3
+ CLUSTER={{ cluster }}
4
+ DOMAIN={{ domain }}
5
+
6
+ [ "$(hostname -s)" == "{{ cluster }}-bootstrap" ] || which crictl >/dev/null 2>&1
4
7
  if [ "$?" != "0" ] ; then
5
8
  exit 0
6
9
  fi
7
10
 
8
- if [ "$2" = "dhcp4-change" ] || [ "$2" = "dhcp6-change" ] || [ "$2" = "up" ] || [ "$2" = "connectivity-change" ]; then
11
+ if [ "$(grep '# kcli' /etc/resolv.conf)" == "" ] ; then
9
12
  sleep 2
10
13
  NIC={{ "$(ip -6 r | grep -v lo | head -1 | grep -oP '(?<=dev )[^ ]*')" if ipv6 else "$(ip r | grep default | head -1 | grep -oP '(?<=dev )[^ ]*')" }}
11
14
  IP={{ "$(ip -o -f inet6 addr show $NIC | head -1 | grep -oP '(?<=inet6 )[^ ]*' | cut -d '/' -f 1)" if ipv6 else "$(ip -o -f inet addr show $NIC | head -1 | grep -oP '(?<=inet )[^ ]*' | cut -d '/' -f 1)" }}
12
- if [ "$IP" != "" ] ; then
13
- grep -q $IP /etc/resolv.conf
14
- if [ "$?" != "0" ] ; then
15
- sed -i 's/{{ cluster }}.{{ domain }}//' /etc/resolv.conf
16
- sed -i 's/search /search {{ cluster }}.{{ domain }} /' /etc/resolv.conf
17
- sed -i "/nameserver.* #coredns/d" /etc/resolv.conf
18
- sed -i "0,/nameserver/s/nameserver/nameserver $IP #coredns\n&/" /etc/resolv.conf
19
- fi
20
- fi
15
+ sed -i "s/$CLUSTER.$DOMAIN//" /etc/resolv.conf
16
+ sed -i "s/search /search $CLUSTER.$DOMAIN /" /etc/resolv.conf
17
+ sed -i "0,/nameserver/s/nameserver/nameserver $IP # kcli\n&/" /etc/resolv.conf
21
18
  fi
@@ -710,6 +710,8 @@ def create(config, plandir, cluster, overrides, dnsconfig=None):
710
710
  data['sno'] = sno
711
711
  sno_wait = overrides.get('sno_wait') or baremetal_sno or data['api_ip'] is not None or sno_vm
712
712
  sno_disk = data['sno_disk']
713
+ if sno_disk is not None and not sno_disk.startswith('/dev/'):
714
+ sno_disk = f'/dev/{sno_disk}'
713
715
  sno_ctlplanes = data['sno_ctlplanes'] or baremetal_ctlplane
714
716
  sno_workers = data['sno_workers']
715
717
  sno_telco = data['sno_telco']
@@ -936,12 +938,18 @@ def create(config, plandir, cluster, overrides, dnsconfig=None):
936
938
  tag = f'registry.ci.openshift.org/{basetag}/release:{tag}'
937
939
  which_openshift = which('openshift-install')
938
940
  openshift_dir = os.path.dirname(which_openshift) if which_openshift is not None else '.'
939
- if which_openshift is not None and not has_internet():
940
- pprint("Using existing openshift-install found in your PATH")
941
- warning("Not checking version")
942
- elif okd:
943
- run = get_okd_installer(tag, version=version)
944
- elif not same_release_images(version=version, tag=tag, pull_secret=pull_secret, path=openshift_dir):
941
+ if which_openshift is None:
942
+ download = True
943
+ elif not has_internet:
944
+ pprint("Using existing openshift-install found in your PATH and skipping version check")
945
+ download = False
946
+ else:
947
+ download = not same_release_images(version=version, tag=tag, pull_secret=pull_secret, path=openshift_dir)
948
+ if download:
949
+ pprint("Redownloading openshift-install as found version doesn't match requirements")
950
+ if download:
951
+ if okd:
952
+ run = get_okd_installer(tag, version=version)
945
953
  if version in ['ci', 'nightly'] or '/' in str(tag):
946
954
  nightly = version == 'nightly'
947
955
  run = get_ci_installer(pull_secret, tag=tag, nightly=nightly)
@@ -952,10 +960,6 @@ def create(config, plandir, cluster, overrides, dnsconfig=None):
952
960
  if run != 0:
953
961
  return {'result': 'failure', 'reason': "Couldn't download openshift-install"}
954
962
  pprint("Move downloaded openshift-install somewhere in your PATH if you want to reuse it")
955
- elif which_openshift is not None:
956
- pprint("Using existing openshift-install found in your PATH")
957
- else:
958
- pprint("Reusing matching openshift-install")
959
963
  os.environ["PATH"] = f'{os.getcwd()}:{os.environ["PATH"]}'
960
964
  INSTALLER_VERSION = get_installer_version()
961
965
  pprint(f"Using installer version {INSTALLER_VERSION}")
@@ -1171,10 +1175,13 @@ def create(config, plandir, cluster, overrides, dnsconfig=None):
1171
1175
  if not f.endswith('.yml') and not f.endswith('.yaml'):
1172
1176
  warning(f"Skipping manifest {f}")
1173
1177
  continue
1174
- if f == '99-openshift-disconnected-catalog.yaml' and disconnected_url is not None:
1175
- content = content.replace('REGISTRY', disconnected_url).replace('TAG', OPENSHIFT_TAG)
1178
+ if f == '99-openshift-disconnected-catalog.yaml':
1179
+ if disconnected_url is not None:
1180
+ content = content.replace('REGISTRY', disconnected_url).replace('TAG', OPENSHIFT_TAG)
1181
+ else:
1182
+ continue
1176
1183
  if f == '98-var-lib-containers-partitioned.yaml':
1177
- content = content.replace('DISK', sno_disk or '/dev/sda')
1184
+ content = content.replace('SNO_DISK', sno_disk or '/dev/sda')
1178
1185
  pprint(f"Injecting manifest {f}")
1179
1186
  with open(f'{clusterdir}/openshift/{f}', 'w') as f:
1180
1187
  f.write(content)
@@ -13,18 +13,15 @@ mirror:
13
13
  platform:
14
14
  graph: false
15
15
  {% if version in ['ci', 'nightly'] %}
16
- {% set release = 'origin/release-scos:scos-%s' % tag if okd else 'registry.ci.openshift.org/ocp/release:%s' % tag %}
16
+ {% set release = 'origin/release-scos:scos-%s' % tag if okd else 'ocp/release:%s' % tag %}
17
17
  release: registry.ci.openshift.org/{{ release }}
18
18
  {% else %}
19
19
  channels:
20
20
  - name: {{ disconnected_channel or ('candidate' if 'rc' in tag else 'stable') }}-{{ release }}
21
- {% if tag|count('.') > 1 %}
22
- minVersion: {{ (disconnected_extra_release or tag)|min_ocp_version(tag) }}
23
- maxVersion: {{ (disconnected_extra_release or tag)|max_ocp_version(tag) }}
24
- {% endif %}
21
+ minVersion: {{ (disconnected_extra_release or openshift_version)|min_ocp_version(openshift_version) }}
22
+ maxVersion: {{ (disconnected_extra_release or openshift_version)|max_ocp_version(openshift_version) }}
25
23
  {% endif %}
26
24
  architectures:
27
- # - multi
28
25
  - amd64
29
26
  additionalImages:
30
27
  {% for image in kcli_images + extra_images|default([]) %}
@@ -1,9 +1,9 @@
1
1
  if [ "$(which dnf)" != "" ] ; then
2
2
  echo "fastestmirror=1" >> /etc/dnf/dnf.conf
3
- dnf -y install podman httpd httpd-tools jq skopeo libseccomp-devel haproxy
3
+ dnf -y install podman httpd httpd-tools jq skopeo libseccomp-devel haproxy runc
4
4
  else
5
5
  apt-get update
6
- apt-get -y install podman apache2 apache2-utils jq skopeo haproxy
6
+ apt-get -y install podman apache2 apache2-utils jq skopeo haproxy runc
7
7
  fi
8
8
 
9
9
  curl https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/stable/openshift-client-linux.tar.gz | tar zxf - oc
@@ -45,6 +45,6 @@ else
45
45
  update-ca-certificates
46
46
  fi
47
47
  htpasswd -bBc /opt/registry/auth/htpasswd $REGISTRY_USER $REGISTRY_PASSWORD
48
- podman create --name registry --net host --security-opt label=disable -v /opt/registry/data:/var/lib/registry:z -v /opt/registry/auth:/auth:z -v /opt/registry/conf/config.yml:/etc/docker/registry/config.yml -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry" -e "REGISTRY_HTTP_SECRET=ALongRandomSecretForRegistry" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /opt/registry/certs:/certs:z -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key $REGISTRY_IMAGE
48
+ podman create --name registry --net host --runtime=runc --security-opt label=disable -v /opt/registry/data:/var/lib/registry:z -v /opt/registry/auth:/auth:z -v /opt/registry/conf/config.yml:/etc/docker/registry/config.yml -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry" -e "REGISTRY_HTTP_SECRET=ALongRandomSecretForRegistry" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd -v /opt/registry/certs:/certs:z -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key $REGISTRY_IMAGE
49
49
  [ "$?" == "0" ] || !!
50
50
  systemctl enable --now registry
kvirt/config.py CHANGED
@@ -135,7 +135,7 @@ class Kconfig(Kbaseconfig):
135
135
  except Exception as e:
136
136
  exception = e if debug else None
137
137
  dependency_error('hcloud', exception)
138
- k = Khcloud(api_key=apikey, location=location)
138
+ k = Khcloud(api_key=apikey, location=location, debug=debug)
139
139
  elif self.type == 'azure':
140
140
  try:
141
141
  from kvirt.providers.azure import Kazure
@@ -1067,8 +1067,11 @@ class Kconfig(Kbaseconfig):
1067
1067
  if index < len(disks):
1068
1068
  disk = disks[index]
1069
1069
  currentdisksize = currentdisk['size']
1070
- disksize = disk.get('size', 10) if isinstance(disk, dict) else int(disk)
1071
- if disksize > currentdisksize:
1070
+ disksize = disk.get('size', 10) if isinstance(disk, dict) else int(disk) if disk.isdigit() else None
1071
+ if disksize is None:
1072
+ warning(f"Invalid Disk {index} value {disk} in {name}")
1073
+ break
1074
+ elif disksize > currentdisksize:
1072
1075
  if currentvm.get('status') != 'down':
1073
1076
  warning(f"Cant resize Disk {index} in {name} while VM is up")
1074
1077
  break
kvirt/kmcp.py CHANGED
@@ -9,6 +9,10 @@ from typing import Optional, List, Dict, Any
9
9
  from urllib.request import urlopen
10
10
 
11
11
 
12
+ def handle_none(values):
13
+ return [None if e is not None and isinstance(e, str) and 'none' in e.lower() else e for e in values]
14
+
15
+
12
16
  def _parse_vms_list(_list, overrides={}):
13
17
  if isinstance(_list, str):
14
18
  print(_list)
@@ -62,6 +66,7 @@ def create_kube(context: Context,
62
66
  disks: List[Dict] = [], nets: List[Dict] = [], sno_vm: bool = False,
63
67
  client: str = None, debug: bool = False, region: str = None,
64
68
  zone: str = None, namespace: str = None, overrides: Dict[str, Any] = {}) -> Dict[str, Any]:
69
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
65
70
  """Create cluster"""
66
71
  if disks:
67
72
  overrides['disk_size'] = disks[0]['size'] if isinstance(disks[0], dict) else disks[0]
@@ -109,6 +114,7 @@ def create_network(context: Context,
109
114
  client: str = None, debug: bool = False, region: str = None,
110
115
  zone: str = None, namespace: str = None, overrides: dict = {}) -> dict:
111
116
  """Create network"""
117
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
112
118
  nodhcp = not dhcp if dhcp is not None else nodhcp
113
119
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
114
120
  k = config.k
@@ -128,6 +134,7 @@ def create_plan(context: Context,
128
134
  client: str = None, debug: bool = False, region: str = None,
129
135
  zone: str = None, namespace: str = None, overrides: dict = {}) -> dict:
130
136
  """Create plan"""
137
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
131
138
  # if container_mode():
132
139
  # inputfile = f"/workdir/{inputfile}"
133
140
  if 'minimum_version' in overrides:
@@ -159,6 +166,7 @@ def create_pool(context: Context,
159
166
  client: str = None, debug: bool = False, region: str = None,
160
167
  zone: str = None, namespace: str = None) -> dict:
161
168
  """Create pool"""
169
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
162
170
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
163
171
  k = config.k
164
172
  if path is None:
@@ -173,6 +181,7 @@ def create_vm(context: Context,
173
181
  client: str = None, debug: bool = False, region: str = None,
174
182
  zone: str = None, namespace: str = None, overrides: dict = {}) -> dict:
175
183
  """Create vm"""
184
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
176
185
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
177
186
  return config.create_vm(name, profile, overrides=overrides)
178
187
 
@@ -183,6 +192,7 @@ def delete_kube(context: Context,
183
192
  client: str = None, debug: bool = False, region: str = None,
184
193
  zone: str = None, namespace: str = None, overrides: dict = {}):
185
194
  """Delete cluster"""
195
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
186
196
  if client is not None:
187
197
  overrides['client'] = client
188
198
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
@@ -197,6 +207,7 @@ def delete_network(context: Context,
197
207
  client: str = None, debug: bool = False, region: str = None,
198
208
  zone: str = None, namespace: str = None) -> Dict[str, Any]:
199
209
  """Delete network"""
210
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
200
211
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
201
212
  k = config.k
202
213
  for name in names:
@@ -212,6 +223,7 @@ def delete_plan(context: Context,
212
223
  client: str = None, debug: bool = False, region: str = None,
213
224
  zone: str = None, namespace: str = None) -> Dict[str, Any]:
214
225
  """Delete plan"""
226
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
215
227
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
216
228
  plans = [p[0] for p in config.list_plans()] if allplans else plans
217
229
  for plan in plans:
@@ -227,6 +239,7 @@ def delete_pool(context: Context,
227
239
  client: str = None, debug: bool = False, region: str = None,
228
240
  zone: str = None, namespace: str = None) -> dict:
229
241
  """Delete pool"""
242
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
230
243
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
231
244
  k = config.k
232
245
  return k.delete_pool(name=pool, full=full)
@@ -238,6 +251,7 @@ def delete_vm(context: Context,
238
251
  client: str = None, debug: bool = False, region: str = None,
239
252
  zone: str = None, namespace: str = None) -> dict:
240
253
  """Delete vm"""
254
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
241
255
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
242
256
  return config.k.delete(vm)
243
257
 
@@ -248,6 +262,7 @@ def info_vm(context: Context,
248
262
  client: str = None, debug: bool = False, region: str = None,
249
263
  zone: str = None, namespace: str = None) -> dict:
250
264
  """Get info of vm"""
265
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
251
266
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
252
267
  return config.k.info(name)
253
268
 
@@ -256,6 +271,8 @@ def info_vm(context: Context,
256
271
  def list_clients(context: Context,
257
272
  client: str = None, debug: bool = False) -> list:
258
273
  """List clients"""
274
+ if client is not None and client.lower() == 'none':
275
+ client = None
259
276
  clientstable = ["Client", "Type", "Enabled", "Current"]
260
277
  baseconfig = Kbaseconfig(client=client, debug=debug)
261
278
  for client in sorted(baseconfig.clients):
@@ -273,6 +290,7 @@ def list_clusters(context: Context,
273
290
  client: str = None, debug: bool = False, region: str = None,
274
291
  zone: str = None, namespace: str = None) -> list:
275
292
  """List clusters"""
293
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
276
294
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
277
295
  return config.k.list_kubes()
278
296
 
@@ -282,6 +300,7 @@ def list_images(context: Context,
282
300
  client: str = None, debug: bool = False, region: str = None,
283
301
  zone: str = None, namespace: str = None) -> list:
284
302
  """List images"""
303
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
285
304
  return Kconfig(client=client).k.volumes()
286
305
 
287
306
 
@@ -290,6 +309,7 @@ def list_networks(context: Context,
290
309
  client: str = None, debug: bool = False, region: str = None,
291
310
  zone: str = None, namespace: str = None) -> dict:
292
311
  """List networks"""
312
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
293
313
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
294
314
  return config.k.list_networks()
295
315
 
@@ -299,6 +319,7 @@ def list_pools(context: Context,
299
319
  client: str = None, debug: bool = False, region: str = None,
300
320
  zone: str = None, namespace: str = None) -> list:
301
321
  """List pools"""
322
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
302
323
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
303
324
  return config.k.list_pools()
304
325
 
@@ -308,6 +329,7 @@ def list_vms(context: Context,
308
329
  client: str = None, debug: bool = False, region: str = None,
309
330
  zone: str = None, namespace: str = None) -> list:
310
331
  """List vms"""
332
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
311
333
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
312
334
  return config.k.list()
313
335
 
@@ -318,6 +340,7 @@ def scale_kube(context: Context,
318
340
  client: str = None, debug: bool = False, region: str = None,
319
341
  zone: str = None, namespace: str = None, overrides: dict = {}) -> dict:
320
342
  """Scale cluster"""
343
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
321
344
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
322
345
  if ctlplanes is not None:
323
346
  overrides['ctlplanes'] = ctlplanes
@@ -332,6 +355,7 @@ def start_plan(context: Context,
332
355
  client: str = None, debug: bool = False, region: str = None,
333
356
  zone: str = None, namespace: str = None) -> Dict[str, Any]:
334
357
  """Start plan"""
358
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
335
359
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
336
360
  for plan in plans:
337
361
  result = config.start_plan(plan)
@@ -346,6 +370,7 @@ def start_vm(context: Context,
346
370
  client: str = None, debug: bool = False, region: str = None,
347
371
  zone: str = None, namespace: str = None) -> dict:
348
372
  """Start vm"""
373
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
349
374
  return Kconfig(client).k.start(name)
350
375
 
351
376
 
@@ -355,6 +380,7 @@ def stop_plan(context: Context,
355
380
  client: str = None, debug: bool = False, region: str = None,
356
381
  zone: str = None, namespace: str = None) -> Dict[str, Any]:
357
382
  """Stop plan"""
383
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
358
384
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
359
385
  for plan in plans:
360
386
  result = config.stop_plan(plan, soft=soft)
@@ -369,6 +395,7 @@ def stop_vm(context: Context,
369
395
  client: str = None, debug: bool = False, region: str = None,
370
396
  zone: str = None, namespace: str = None) -> dict:
371
397
  """Stop vm"""
398
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
372
399
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
373
400
  return config.k.stop(name)
374
401
 
@@ -379,6 +406,7 @@ def create_bucket(context: Context,
379
406
  client: str = None, debug: bool = False, region: str = None,
380
407
  zone: str = None, namespace: str = None):
381
408
  """Create bucket"""
409
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
382
410
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
383
411
  k = config.k
384
412
  for bucket in buckets:
@@ -391,6 +419,7 @@ def create_bucketfile(context: Context,
391
419
  client: str = None, debug: bool = False, region: str = None,
392
420
  zone: str = None, namespace: str = None) -> str:
393
421
  """Create bucketfile in bucket"""
422
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
394
423
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
395
424
  k = config.k
396
425
  return k.upload_to_bucket(bucket, path, temp_url=temp, public=public)
@@ -402,6 +431,7 @@ def create_dns(context: Context,
402
431
  client: str = None, debug: bool = False, region: str = None,
403
432
  zone: str = None, namespace: str = None):
404
433
  """Create dns entry"""
434
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
405
435
  if alias is None:
406
436
  alias = []
407
437
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
@@ -419,6 +449,7 @@ def create_lb(context: Context,
419
449
  client: str = None, debug: bool = False, region: str = None,
420
450
  zone: str = None, namespace: str = None):
421
451
  """Create load balancer"""
452
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
422
453
  if name is None:
423
454
  name = get_random_name().replace('_', '-')
424
455
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
@@ -432,6 +463,7 @@ def create_securitygroup(context: Context,
432
463
  client: str = None, debug: bool = False, region: str = None,
433
464
  zone: str = None, namespace: str = None, overrides: dict = {}) -> dict:
434
465
  """Create security group"""
466
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
435
467
  securitygroup = securitygroup
436
468
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
437
469
  k = config.k
@@ -444,6 +476,7 @@ def delete_bucket(context: Context,
444
476
  client: str = None, debug: bool = False, region: str = None,
445
477
  zone: str = None, namespace: str = None):
446
478
  """Delete bucket"""
479
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
447
480
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
448
481
  k = config.k
449
482
  for bucket in buckets:
@@ -456,6 +489,7 @@ def delete_bucketfile(context: Context,
456
489
  client: str = None, debug: bool = False, region: str = None,
457
490
  zone: str = None, namespace: str = None):
458
491
  """Delete bucketfile from bucket"""
492
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
459
493
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
460
494
  k = config.k
461
495
  k.delete_from_bucket(bucket, path)
@@ -467,6 +501,7 @@ def delete_dns(context: Context,
467
501
  client: str = None, debug: bool = False, region: str = None,
468
502
  zone: str = None, namespace: str = None):
469
503
  """Delete dns entry"""
504
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
470
505
  domain = domain or net
471
506
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
472
507
  k = config.k
@@ -479,6 +514,7 @@ def delete_lb(context: Context,
479
514
  names: list = [], client: str = None, debug: bool = False, region: str = None,
480
515
  zone: str = None, namespace: str = None):
481
516
  """Delete load balancer"""
517
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
482
518
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
483
519
  for name in names:
484
520
  config.delete_loadbalancer(name)
@@ -490,6 +526,7 @@ def delete_securitygroup(context: Context,
490
526
  client: str = None, debug: bool = False, region: str = None,
491
527
  zone: str = None, namespace: str = None):
492
528
  """Delete security group"""
529
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
493
530
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
494
531
  k = config.k
495
532
  for securitygroup in securitygroups:
@@ -502,6 +539,7 @@ def download_bucketfile(context: Context,
502
539
  client: str = None, debug: bool = False, region: str = None,
503
540
  zone: str = None, namespace: str = None):
504
541
  """Download bucketfile from bucket"""
542
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
505
543
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
506
544
  k = config.k
507
545
  k.download_from_bucket(bucket, path)
@@ -513,6 +551,7 @@ def list_bucketfiles(context: Context,
513
551
  client: str = None, debug: bool = False, region: str = None,
514
552
  zone: str = None, namespace: str = None) -> list:
515
553
  """List bucketfiles of bucket"""
554
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
516
555
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
517
556
  k = config.k
518
557
  return k.list_bucketfiles(bucket)
@@ -523,6 +562,7 @@ def list_buckets(context: Context,
523
562
  client: str = None, debug: bool = False, region: str = None,
524
563
  zone: str = None, namespace: str = None) -> list:
525
564
  """List buckets"""
565
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
526
566
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
527
567
  k = config.k
528
568
  return k.list_buckets()
@@ -534,6 +574,7 @@ def list_dns_entries(context: Context,
534
574
  client: str = None, debug: bool = False, region: str = None,
535
575
  zone: str = None, namespace: str = None) -> list:
536
576
  """List dns entries"""
577
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
537
578
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
538
579
  if domain is None:
539
580
  return config.k.list_dns_zones()
@@ -546,6 +587,7 @@ def list_lbs(context: Context,
546
587
  client: str = None, debug: bool = False, region: str = None,
547
588
  zone: str = None, namespace: str = None) -> list:
548
589
  """List load balancers"""
590
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
549
591
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
550
592
  return config.list_loadbalancers()
551
593
 
@@ -556,6 +598,7 @@ def list_securitygroups(context: Context,
556
598
  client: str = None, debug: bool = False, region: str = None,
557
599
  zone: str = None, namespace: str = None) -> list:
558
600
  """List security groups"""
601
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
559
602
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
560
603
  k = config.k
561
604
  return k.list_security_groups(network=network)
@@ -567,6 +610,7 @@ def update_securitygroup(context: Context,
567
610
  client: str = None, debug: bool = False, region: str = None,
568
611
  zone: str = None, namespace: str = None, overrides: dict = {}):
569
612
  """Update security group"""
613
+ client, region, zone, namespace = handle_none([client, region, zone, namespace])
570
614
  config = Kconfig(client=client, debug=debug, region=region, zone=zone, namespace=namespace)
571
615
  result = config.k.update_security_group(name=securitygroup, overrides=overrides)
572
616
  common.handle_response(result, securitygroup, element='SecurityGroup', action='updated')
@@ -15,10 +15,11 @@ import os
15
15
 
16
16
 
17
17
  class Khcloud():
18
- def __init__(self, api_key=None, location=None):
18
+ def __init__(self, api_key=None, location=None, debug=False):
19
19
  self.conn = Client(token=api_key)
20
20
  self.location = self.conn.locations.get_by_name(location)
21
21
  self.machine_flavor_cache = {}
22
+ self.debug = debug
22
23
  return
23
24
 
24
25
  def create(self, name, virttype=None, profile='', flavor=None, plan='kvirt', cpumodel='host-model', cpuflags=[],
@@ -533,7 +534,7 @@ class Khcloud():
533
534
  for disk in alldisks:
534
535
  if self.debug:
535
536
  print(disk)
536
- disks[disk.name] = {'pool': "", 'path': self.location}
537
+ disks[disk.name] = {'pool': "", 'path': disk.location.name}
537
538
  return disks
538
539
 
539
540
  def list_buckets(self):
@@ -1449,7 +1449,8 @@ class Kvirt(object):
1449
1449
  xml = vm.XMLDesc(0)
1450
1450
  root = ET.fromstring(xml)
1451
1451
  for _os in list(root.iter('os')):
1452
- if list(_os.iter('boot'))[0].get('dev') == 'cdrom':
1452
+ boot = _os.iter('boot')
1453
+ if boot is not None and list(boot)[0].get('dev') == 'cdrom':
1453
1454
  return {'result': 'success'}
1454
1455
  newxml = ET.tostring(root).decode("utf-8")
1455
1456
  newxml = newxml.replace('dev="cdrom"', 'dev="TEMP"')
@@ -1960,7 +1961,7 @@ class Kvirt(object):
1960
1961
  if ips and 'ip' not in yamlinfo:
1961
1962
  ip4s = [i for i in ips if ':' not in i]
1962
1963
  ip6s = [i for i in ips if i not in ip4s]
1963
- yamlinfo['ip'] = ip4s[0] if ip4s else ip6s[0]
1964
+ yamlinfo['ip'] = ip4s[0] if ip4s else ip6s[-1]
1964
1965
  if len(all_ips) > 1:
1965
1966
  yamlinfo['ips'] = all_ips
1966
1967
  pcidevices = []
@@ -2692,7 +2693,6 @@ class Kvirt(object):
2692
2693
  else:
2693
2694
  vm.setVcpus(numcpus)
2694
2695
  return {'result': 'success'}
2695
- warning("Note it will only be effective upon next start")
2696
2696
  cpunode.text = str(numcpus)
2697
2697
  newxml = ET.tostring(root).decode("utf-8")
2698
2698
  conn.defineXML(newxml)
kvirt/version/git CHANGED
@@ -1 +1 @@
1
- 1101de4 2025/10/23
1
+ e2cb617 2025/11/27