fastcloudinit 0.0.3__py3-none-any.whl → 0.0.5__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.
fastcloudinit/__init__.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.0.3"
1
+ __version__ = "0.0.5"
2
2
  from .core import *
fastcloudinit/_modidx.py CHANGED
@@ -6,6 +6,7 @@ d = { 'settings': { 'branch': 'main',
6
6
  'git_url': 'https://github.com/AnswerDotAI/fastcloudinit',
7
7
  'lib_path': 'fastcloudinit'},
8
8
  'syms': { 'fastcloudinit.core': { 'fastcloudinit.core.apt': ('core.html#apt', 'fastcloudinit/core.py'),
9
+ 'fastcloudinit.core.cc_validate': ('core.html#cc_validate', 'fastcloudinit/core.py'),
9
10
  'fastcloudinit.core.cloud_init_base': ('core.html#cloud_init_base', 'fastcloudinit/core.py'),
10
11
  'fastcloudinit.core.cloud_init_config': ('core.html#cloud_init_config', 'fastcloudinit/core.py'),
11
12
  'fastcloudinit.core.log_rotate': ('core.html#log_rotate', 'fastcloudinit/core.py'),
fastcloudinit/core.py CHANGED
@@ -1,13 +1,16 @@
1
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb.
2
2
 
3
3
  # %% auto 0
4
- __all__ = ['ufw', 'user', 'source', 'apt', 'systemd', 'log_rotate', 'phone_home', 'reboot', 'mounts', 'runcmd', 'cloud_init_base',
5
- 'cloud_init_config']
4
+ __all__ = ['ufw', 'user', 'source', 'apt', 'systemd', 'log_rotate', 'phone_home', 'reboot', 'mounts', 'runcmd', 'cc_validate',
5
+ 'cloud_init_base', 'cloud_init_config']
6
6
 
7
7
  # %% ../nbs/00_core.ipynb
8
8
  from fastcore.utils import *
9
- import fastcore.xtras, yaml
10
9
  from textwrap import dedent
10
+ from jsonschema import validate
11
+ from httpx import get as xget
12
+
13
+ import fastcore.xtras, yaml, json
11
14
 
12
15
  # %% ../nbs/00_core.ipynb
13
16
  def ufw(logging="off", def_incoming="deny", def_outgoing="allow", internal=None, **allows):
@@ -88,12 +91,18 @@ def runcmd(cmds):
88
91
  return dict(runcmd=cmds)
89
92
 
90
93
  # %% ../nbs/00_core.ipynb
91
- def cloud_init_base(hostname, packages=None, **kw):
94
+ def cc_validate(d):
95
+ vsc = xget('https://raw.githubusercontent.com/canonical/cloud-init/main/cloudinit/config/schemas/versions.schema.cloud-config.json').text
96
+ validate(d, schema=json.loads(vsc))
97
+
98
+ # %% ../nbs/00_core.ipynb
99
+ def cloud_init_base(hostname, packages=None, check=True, **kw):
92
100
  cfg = dict(
93
101
  hostname=hostname, preserve_hostname=False,
94
102
  packages=listify(packages), package_update=True, package_upgrade=True,
95
103
  disable_root=True, ssh_pwauth=False, **kw
96
104
  )
105
+ if check: cc_validate(cfg)
97
106
  return "#cloud-config\n" + yaml.safe_dump(cfg, sort_keys=False, width=1_000_000)
98
107
 
99
108
  # %% ../nbs/00_core.ipynb
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastcloudinit
3
- Version: 0.0.3
3
+ Version: 0.0.5
4
4
  Summary: Simplified opinionated cloud init for ubuntu
5
5
  Home-page: https://github.com/AnswerDotAI/fastcloudinit
6
6
  Author: Jeremy Howard
@@ -20,6 +20,8 @@ Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
21
  Requires-Dist: fastcore
22
22
  Requires-Dist: PyYAML
23
+ Requires-Dist: httpx
24
+ Requires-Dist: jsonschema
23
25
  Provides-Extra: dev
24
26
  Dynamic: author
25
27
  Dynamic: author-email
@@ -0,0 +1,9 @@
1
+ fastcloudinit/__init__.py,sha256=vcF3PxICb5jmbcz0MoaVcpqURhdQQbFoHZ8V2L6D5Ls,42
2
+ fastcloudinit/_modidx.py,sha256=ecixB-qcLgfacA5TepGM-CFj6X4Gbj1VWp4Qx8K5FOQ,1805
3
+ fastcloudinit/core.py,sha256=-awexBYlN3D5EWg8G79ZybNBWrS0T8Uv-zcO7OgRPiQ,4453
4
+ fastcloudinit-0.0.5.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
+ fastcloudinit-0.0.5.dist-info/METADATA,sha256=X_dZIakr4ESc4bivMAGoxWfyszLfCz6q86GfOGqaPbM,1488
6
+ fastcloudinit-0.0.5.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
7
+ fastcloudinit-0.0.5.dist-info/entry_points.txt,sha256=VM6Nnsreaik0SzaZUuuwlWvlBKXIt35OXaFWekbNNY8,48
8
+ fastcloudinit-0.0.5.dist-info/top_level.txt,sha256=hVbcvprAQ-MXDFdjn5FkVecIwHYPMUikFR7aRiVHkt4,14
9
+ fastcloudinit-0.0.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.0)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,9 +0,0 @@
1
- fastcloudinit/__init__.py,sha256=DyjzzgRJvp3QnEDlrwpSgOvDRy9Thxh14LVq-rV7GgI,42
2
- fastcloudinit/_modidx.py,sha256=Wfejm8MTpUUfUqzwtaLDYWPjqaQu81Bi_FdTMW0Heu4,1683
3
- fastcloudinit/core.py,sha256=fff9PYHv8u1D7UvtDavEXODi_nICf909BccsIZ20R8U,4097
4
- fastcloudinit-0.0.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
5
- fastcloudinit-0.0.3.dist-info/METADATA,sha256=UUgBqHar4bFvZbTraYrExVQ2HuYrwLzgpfE77kVCLVU,1441
6
- fastcloudinit-0.0.3.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
7
- fastcloudinit-0.0.3.dist-info/entry_points.txt,sha256=VM6Nnsreaik0SzaZUuuwlWvlBKXIt35OXaFWekbNNY8,48
8
- fastcloudinit-0.0.3.dist-info/top_level.txt,sha256=hVbcvprAQ-MXDFdjn5FkVecIwHYPMUikFR7aRiVHkt4,14
9
- fastcloudinit-0.0.3.dist-info/RECORD,,