-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a simple INI handler, and a helper function under Installer().c…
…onfigure_nic() to help with nic configuration. Supports a crude DHCP configuration and a minimal static IP handler.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,5 @@ SAFETY_LOCK | |
**/**.pkg.*.xz | ||
**/**archinstall-*.tar.gz | ||
**/**.zst | ||
**/**.network | ||
**/**.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class Ini(): | ||
def __init__(self, *args, **kwargs): | ||
""" | ||
Limited INI handler for now. | ||
Supports multiple keywords through dictionary list items. | ||
""" | ||
self.kwargs = kwargs | ||
|
||
def __str__(self): | ||
result = '' | ||
first_row_done = False | ||
for top_level in self.kwargs: | ||
if first_row_done: | ||
result += f"\n[{top_level}]\n" | ||
else: | ||
result += f"[{top_level}]\n" | ||
first_row_done = True | ||
|
||
for key, val in self.kwargs[top_level].items(): | ||
if type(val) == list: | ||
for item in val: | ||
result += f"{key}={item}\n" | ||
else: | ||
result += f"{key}={val}\n" | ||
|
||
return result | ||
|
||
class Systemd(Ini): | ||
def __init__(self, *args, **kwargs): | ||
""" | ||
Placeholder class to do systemd specific setups. | ||
""" | ||
super(Systemd, self).__init__(*args, **kwargs) | ||
|
||
class Networkd(Systemd): | ||
def __init__(self, *args, **kwargs): | ||
""" | ||
Placeholder class to do systemd-network specific setups. | ||
""" | ||
super(Networkd, self).__init__(*args, **kwargs) |