mcp-souschef 3.0.0__py3-none-any.whl → 3.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
souschef/deployment.py CHANGED
@@ -10,6 +10,7 @@ import json
10
10
  import re
11
11
  from pathlib import Path
12
12
  from typing import Any
13
+ from urllib.parse import urlparse
13
14
 
14
15
  from souschef.core.constants import (
15
16
  CHEF_RECIPE_PREFIX,
@@ -258,10 +259,11 @@ def generate_awx_inventory_source_from_chef(
258
259
  "(e.g., https://chef.example.com)"
259
260
  )
260
261
 
261
- if not chef_server_url.startswith("https://"):
262
+ parsed_url = urlparse(chef_server_url)
263
+ if parsed_url.scheme != "https" or not parsed_url.netloc:
262
264
  return (
263
265
  f"Error: Invalid Chef server URL: {chef_server_url}\n\n"
264
- "Suggestion: URL must use HTTPS protocol for security "
266
+ "Suggestion: URL must use HTTPS protocol with a valid host "
265
267
  "(e.g., https://chef.example.com)"
266
268
  )
267
269
 
@@ -983,7 +985,12 @@ def main():
983
985
  # Chef server configuration
984
986
  chef_server_url = os.environ.get('CHEF_SERVER_URL', '{chef_server_url}')
985
987
  client_name = os.environ.get('CHEF_NODE_NAME', 'admin')
986
- client_key = os.environ.get('CHEF_CLIENT_KEY', '/etc/chef/client.pem')
988
+ # Client key path should be customizable - use environment variable with
989
+ # home directory default instead of hardcoded /etc/chef/client.pem
990
+ client_key = os.environ.get(
991
+ 'CHEF_CLIENT_KEY',
992
+ os.path.expanduser('~/.chef/client.pem')
993
+ )
987
994
 
988
995
  # Initialize Chef API
989
996
  try:
@@ -0,0 +1,13 @@
1
+ """Ansible artifact generators."""
2
+
3
+ from souschef.generators.repo import (
4
+ RepoType,
5
+ analyse_conversion_output,
6
+ generate_ansible_repository,
7
+ )
8
+
9
+ __all__ = [
10
+ "RepoType",
11
+ "analyse_conversion_output",
12
+ "generate_ansible_repository",
13
+ ]