{"id":27657,"library":"cloudshell-shell-core","title":"cloudshell-shell-core","description":"Core package for all CloudShell Shells, providing basic driver interfaces, metadata definitions, utilities, and helpers. Current version: 6.0.2. Released under Apache 2.0, maintained by QualiSystems. Regular releases on PyPI.","status":"active","version":"6.0.2","language":"python","source_language":"en","source_url":"https://github.com/QualiSystems/cloudshell-shell-core","tags":["cloudshell","shell","orchestration","driver","qualisystems"],"install":[{"cmd":"pip install cloudshell-shell-core","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Provides core connectivity and API functionality","package":"cloudshell-core","optional":false}],"imports":[{"note":"Correct module is driver_context, not context","wrong":"from cloudshell.shell.core.context import ConnectivityContext","symbol":"ConnectivityContext","correct":"from cloudshell.shell.core.driver_context import ConnectivityContext"},{"note":"Common mistake: context module renamed to driver_context in v5.1","wrong":"from cloudshell.shell.core.context import ResourceCommandContext","symbol":"ResourceCommandContext","correct":"from cloudshell.shell.core.driver_context import ResourceCommandContext"},{"note":"","wrong":"","symbol":"OrchestrationSaveRestore","correct":"from cloudshell.shell.core.orchestration import OrchestrationSaveRestore"},{"note":"","wrong":"","symbol":"Shell","correct":"from cloudshell.shell.core.driver_context import Shell"}],"quickstart":{"code":"from cloudshell.shell.core.driver_context import ResourceCommandContext, ConnectivityContext\nfrom cloudshell.shell.core.configuration import ShellConfiguration\nfrom cloudshell.shell.core.session import Session\n\n# Initialize a session (authentication usually via environment variables)\nsession = Session(host=os.environ.get('CLOUDSHELL_SERVER', ''),\n                   token=os.environ.get('CLOUDSHELL_TOKEN', ''))\n\n# Get shell configuration\nconfig = ShellConfiguration(session=session, shell_name='MyShell')\n\nprint(f'Shell version: {config.shell_version}')","lang":"python","description":"Basic usage to initialize a session and get shell configuration."},"warnings":[{"fix":"Remove the logger argument from OrchestrationSaveRestore initialization. Use logging.getLogger() separately if needed.","message":"OrchestrationSaveRestore init no longer accepts a logger parameter. Constructor signature changed in v6.0.0.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Update any code relying on log file naming or category strings. Use the new logging helper from cloudshell-logging.","message":"Logging v2 changes: default log_category changed to \"cloudshell\", and log file prefix always uses resource name (not app name in sandbox).","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Change imports to use `driver_context` module.","message":"Import paths changed in v5.1: context classes moved from `cloudshell.shell.core.context` to `cloudshell.shell.core.driver_context`.","severity":"gotcha","affected_versions":">=5.1.0"},{"fix":"Upgrade Python to 3.7+.","message":"Python 2 support removed in v6.0.0.","severity":"deprecated","affected_versions":">=6.0.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use `from cloudshell.shell.core.driver_context import ...` instead.","cause":"In v5.1, the context module was renamed to driver_context.","error":"ModuleNotFoundError: No module named 'cloudshell.shell.core.context'"},{"fix":"Remove the logger argument from OrchestrationSaveRestore() call.","cause":"OrchestrationSaveRestore constructor removed the logger parameter in v6.0.0.","error":"TypeError: __init__() got an unexpected keyword argument 'logger'"},{"fix":"Use the new context attributes: `context.reservation_context.reservation`.","cause":"Reservation context fields changed in newer versions; access via `reservation_context.reservation` or similar.","error":"AttributeError: 'ResourceCommandContext' object has no attribute 'reservation'"},{"fix":"Import from `cloudshell.core.configuration.ShellConfiguration` or check cloudshell-core package.","cause":"ShellConfiguration may have been moved or removed; use config from cloudshell-core.","error":"ImportError: cannot import name 'ShellConfiguration' from 'cloudshell.shell.core'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}