GitHub user sjcorbett opened a pull request:
https://github.com/apache/brooklyn-client/pull/56
Set ContentType header when adding .yaml and .bom files to the catalog
Using application/x-yaml saves the Brooklyn server the hassle of guessing.
At the moment it's too smart for its own good and gives useless errors about
zipfiles when there are errors in yaml files, e.g. when trying to add yaml
containing an undefined alias.
Before:
```
$ br catalog add mybp.bom
Server error (400): Bundle BasicManagedBundle{symbolicName=null,
version=null, url=n
ull} failed preparation: Unable to read
/tmp/brooklyn-bundle-transient-null-86366849
75390229868.zip when looking for manifest: ZipException: error in opening
zip file
```
After:
```
$ br catalog add mybp.bom
Server error (400): ComposerException: found undefined alias doesntexist
in 'reader', line 23, column 15:
name: *doesntexist
```
I'll look to improve the feedback from Brooklyn's guessing endpoint too.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/sjcorbett/brooklyn-client yaml-ct
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/brooklyn-client/pull/56.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #56
----
commit 635328e2b221bf2ab66cbe1336812b419b319cc1
Author: Sam Corbett <[email protected]>
Date: 2017-07-19T15:11:14Z
Set ContentType when adding .yaml and .bom files to the catalog
Using application/x-yaml saves the Brooklyn server the hassle of
guessing. At the moment it's too smart for its own good and gives
useless errors about zipfiles when there are errors in yaml files.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---