Comments (4)
Can we please have this warning just disabled by default in kube-shell?
yaml.warnings({'YAMLLoadWarning': False})
from kube-shell.
see https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation
from kube-shell.
@ningblue , Thanks for looking into this. We might need to accept a parameter (a switch) to suppress these warnings. Something like --suppress-warnings
that will set the above PYTHONWARNINGS
.
What do you think?
from kube-shell.
To resolve the warning messages, you can modify the code to specify the Loader parameter with the FullLoader implementation while calling the yaml.load() and yaml.load_all() functions.
in kubernetes/config/kube_config.py file,
modify the config_dict = yaml.load(f)
with config_dict = yaml.load(f, Loader=yaml.FullLoader)
and in kubeshell/kubeshell.py file,
modify the for doc in docs:
with for doc in yaml.load_all(fd, Loader=yaml.FullLoader):
The location of the kubernetes/config and kubeshell/ directory depends on how you installed the Kubernetes client library. If you installed the library using pip, the directory is typically located in the site-packages directory of your Python installation.
To find the location, you can use the following command in a terminal:
pip show kubernetes | grep Location
## Location: /usr/local/lib/python3.8/dist-packages
To Change:
sed -i "s/config_dict = yaml.load(f)/config_dict = yaml.load(f, Loader=yaml.FullLoader)/g" /usr/local/lib/python3.8/dist-packages/kubernetes/config/kube_config.py
sed -i "s/for doc in docs:/for doc in yaml.load_all(fd, Loader=yaml.FullLoader):/g" /usr/local/lib/python3.8/dist-packages/kubeshell/kubeshell.py
Note: Change the location with yours.
from kube-shell.
Related Issues (20)
- [UX] YAML syntax highlight?
- Error when input backslash : No escaped character
- how can I switch multiple clusters? HOT 2
- Standard install broken on debian stretch
- Best way to collaborate?
- Server-side autocomplete doesn't work on kubernetes object names with Ubuntu 18.10 HOT 2
- Unable to use kube-shell in wsl (alpine)
- Python 3.7 support (fix deprecated yaml call) HOT 3
- Kube-shell for Windows is not passing input text to kubectl HOT 1
- on startup on RHEL 7.6 notebook get load errors
- [INFORMATION SHARE] A web based kubectl tool.
- Fix simple typo: recieve -> receive
- Execution error HOT 1
- rename-context missing from completion
- command not found: kubeshell HOT 3
- Autosuggestion isn't working on List of available pods HOT 1
- Customize shell prompt
- Command not found HOT 2
- F5 button not able to change namespace
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kube-shell.