'juju model-config foo' fails if a 'foo' directory exists

Bug #1946043 reported by James Troup
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Jordan Barrett

Bug Description

If a directory with the same name as a model-config key exists, 'juju
model-config KEY' fails, e.g.

```
$ juju model-config elmo=test
WARNING key "elmo" is not defined in the current model configuration: possible misspelling
$ juju model-config elmo
ERROR read /home/jujumanage/elmo: is a directory
$ juju model-config --reset elmo
$
```

This affects default model configuration keys too, e.g. no-proxy.

'juju config KEY' doesn't have the same behaviour, e.g.

```
$ mkdir worker-multiplier
$ juju config aodh worker-multiplier
0.25
$
```

Revision history for this message
Harry Pidcock (hpidcock) wrote :

Thank-you for the bug report. I think the best way to resolve this is to change `juju model-config` to require loading from a file to be explicit.

`juju model-config --file elmo.yaml`

This would bring it inline with `juju config`.

Change on juju 3.0 due to breaking model-config behavior.

Changed in juju:
status: New → Confirmed
importance: Undecided → High
milestone: none → 2.9-next
milestone: 2.9-next → 3.0.0
Revision history for this message
Heather Lanigan (hmlanigan) wrote :

This issue exists with other juju commands as well. Deploy gets confused if a directory or file of the same name as the charm you are trying to deploy exists too. I'm sure there are others.

Is there another way to resolve it, besides requiring a file?

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1946043] Re: 'juju model-config foo' fails if a 'foo' directory exists

deploy shouldn't be confused as we should mandate "juju deploy ./foo" for
deploy. If we broke that, we can restore it, because it has always been
required that you have '/' or './' or '../' to clarify a local charm vs
from the store.

'juju config' requires '--file', and I think it would be better to do the
same for 'juju model-config'.

On Wed, Oct 13, 2021 at 2:05 PM Heather Lanigan <email address hidden>
wrote:

> This issue exists with other juju commands as well. Deploy gets
> confused if a directory or file of the same name as the charm you are
> trying to deploy exists too. I'm sure there are others.
>
> Is there another way to resolve it, besides requiring a file?
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1946043
>
> Title:
> 'juju model-config foo' fails if a 'foo' directory exists
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1946043/+subscriptions
>
>

Revision history for this message
Jordan Barrett (barrettj12) wrote :
Changed in juju:
status: Confirmed → Fix Committed
Changed in juju:
assignee: nobody → Jordan Barrett (barrettj12)
Changed in juju:
milestone: 3.0.0 → 3.0-rc2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.