esunar / test4

GNU General Public License v3.0
0 stars 0 forks source link

Missing support for kvm machines #216

Closed esunar closed 1 year ago

esunar commented 1 year ago

Currently, juju-lint supports physical hosts and lxd containers only. If a charm is deployed into kvm (e.g. 5/kvm/0), it is being treated as a lxd container, according to this code:

def is_container(machine): if "/" in machine: return True else: return False

As a result, the 'host only' directive does not apply to this charm.

Example: contrail-analytics charm is deployed into kvm: https://pastebin.ubuntu.com/p/kXyhYTqRqV/

Running juju-lint, it complains about ntp being found unexpectedly, where in fact, ntp should be present on kvm machine:

2019-04-04 11:46:51 [INFO] following subordinates where found unexpectedly: 2019-04-04 11:46:51 [ERROR] -> ntp [contrail-analytics]


Imported from Launchpad using lp2gh.

esunar commented 1 year ago

(by arif-ali) This is an issue that I have with customer, and would like not to see this error. So would really like this merged if possible

esunar commented 1 year ago

(by gabor.meszaros) Actually this is not yet released. Current snap juju-lint is latest/stable: 1.1.dev7+g9c9a145 2020-06-08 (17) 13MB classic but that still doesn't have the mentioned fix merged.

esunar commented 1 year ago

(by arif-ali) Just double checked this on my machine to verify this

arif@arif-laptop:/snap/juju-lint/17/lib/python3.6/site-packages/jujulint$ snap list | grep juju-lint
juju-lint                1.1.dev7+g9c9a145           17     latest/stable    stub              classic
arif@arif-laptop:/snap/juju-lint/17/lib/python3.6/site-packages/jujulint$ grep lxd util.py 
    if "lxd/" in machine: