Since this bug was reported, the generate-tools behaviour is almost correct. The remaining problem is that the --streams option does not work exactly as --help states, and when something is wrong, juju silently goes to streams.canonical.com instead explaining that agents were not found and exiting with an error. When juju falls back to streams.canonical.com, it does not download agents. the streams are useless.
Fix this bug by making juju exit with an error if the expected dir is missing or there are no agents in the dir.
"""
Tools tarballs can are located in either a sub directory called "releases" (legacy),
or a directory named after the stream. By default, if no --stream argument is provided,
metadata for tools in the "released" stream is generated by scanning for tool tarballs
in the "releases" directory.
"""
Juju 2 doesn't really have "releases" like juju 1 did. For extra credit, make "released" the default dir since it is the default agent-streams so that there is a one-to-one relationship between the location of the agents and the selected agent-streams so that juju just works.
I can't reproduce this. It seems to work fine for me:
└── mystreams 25.5.1- trusty- ppc64el. tgz 25.5.2- trusty- ppc64el. tgz 0.0-xenial- amd64.tgz juju-devel- tools.json
└── tools
├── devel
│ ├── fix-ppc.tgz
│ ├── juju-1.
│ ├── juju-1.
│ └── juju-2.
└── streams
└── v1
├── com.ubuntu.
└── index2.json
$ more mystreams/ tools/streams/ v1/com. ubuntu. juju-devel- tools.json
"com.ubuntu. juju:14. 04:ppc64" : {
"version" : "1.25.5.1",
"versions" : {
"20161012" : {
" items": {
"1.25. 5.1-trusty- ppc64": {
"release" : "trusty",
"version" : "1.25.5.1",
"arch": "ppc64",
"size": 13645904,
"path": "devel/ juju-1. 25.5.1- trusty- ppc64el. tgz",
"ftype" : "tar.gz",
"sha256" : "d72791058bf598 da365a2b5257ca6 c953392edf6d942 47308bd671497cb 7e094"
},
"1.25. 5.2-trusty- ppc64": {
"release" : "trusty",
"version" : "1.25.5.2",
"arch": "ppc64",
"size": 13645904,
"path": "devel/ juju-1. 25.5.2- trusty- ppc64el. tgz",
"ftype" : "tar.gz",
"sha256" : "9ef3bbfce32347 52e9f20c78954a0 592b38d30764e98 281845166265a26 873c4"
}
}
"com.ubuntu. juju:14. 04:ppc64el" : {
"version" : "1.25.5.1",
"versions" : {
"20161012" : {
" items": {
"1.25. 5.1-trusty- ppc64el" : {
"release" : "trusty",
"version" : "1.25.5.1",
"arch": "ppc64el",
"size": 13645904,
"path": "devel/ juju-1. 25.5.1- trusty- ppc64el. tgz",
"ftype" : "tar.gz",
"sha256" : "d72791058bf598 da365a2b5257ca6 c953392edf6d942 47308bd671497cb 7e094"
},
"1.25. 5.2-trusty- ppc64el" : {
"release" : "trusty",
"version" : "1.25.5.2",
"arch": "ppc64el",
"size": 13645904,
"path": "devel/ juju-1. 25.5.2- trusty- ppc64el. tgz",
"ftype" : "tar.gz",
"sha256" : "9ef3bbfce32347 52e9f20c78954a0 592b38d30764e98 281845166265a26 873c4"
}
}
"com.ubuntu. juju:16. 04:amd64" : {
"version" : "2.0.0",
"versions" : {
"20161012" : {
" items": {
{
"products": {
"arch": "ppc64",
}
}
},
"arch": "ppc64el",
}
}
},
"arch": "amd64",
...