sls print is including deprecation text
See original GitHub issueYes, version 2.16.0
I’m using “sls print” within a bash script to resolve variables. This is read from YAML format, and piped to a an output file which is also expected to contain YAML. The deprecation text is also written out, which renders it invalid YAML when trying to parse/query with yq library.
Apologies, I cannot include the full configuration. Regardless - there is nothing special to this issue; it simply requires a version of serverless for which “sls print” includes the deprecation text as output, and a script using yq to read any arbitrary property from it.
sls print
–stage ${SLS_STAGE}
–region ${AWS_REGION} \
/tmp/serverless.yml
⚠️⚠️ REPLACE WITH FULL COMMAND OUTPUT
myservice-api | Y A M L Exception --------------------------------------
myservice-api |
myservice-api | incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line in “/var/task/serverless.yml” at line 1, column 32:
myservice-api | Serverless: Deprecation warning: Starting with next major versi …
myservice-api | ^
myservice-api |
myservice-api | Get Support --------------------------------------------
myservice-api | Docs: docs.serverless.com
myservice-api | Bugs: github.com/serverless/serverless/issues
myservice-api | Issues: forum.serverless.com
myservice-api |
myservice-api | Your Environment Information ---------------------------
myservice-api | Operating System: linux
myservice-api | Node Version: 10.18.0
myservice-api | Framework Version: 2.16.0
myservice-api | Plugin Version: 4.3.0
myservice-api | SDK Version: 2.3.2
myservice-api | Components Version: 3.4.3
⚠️⚠️ REPLACE WITH `serverless --version` OUTPUT
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
The env variable worked. Thank you for that! Specifically, I used in my bash startup script:
export SLS_DEPRECATION_DISABLE=*
Hello @thetumper, thanks for reporting back. As for using the variable, I believe you should still be able to prepend your command with
SLS_DEPRECATION_DISABLE
, e.g.SLS_DEPRECATION_DISABLE='*' sls print
.Unfortunately, we don’t have the codes listed anywhere in the documentation, but I’ve just opened an issue that aims to improve existing deprecation documentation: https://github.com/serverless/serverless/issues/8665
As for not including warnings in
print
command, we have a plan for a bigger refactoring/improvement of our logging mechanisms: https://github.com/serverless/serverless/issues/1720 which we will be prioritizing in the near future. That should resolve issue withprint
as well.