Skip to content

Commit

Permalink
Create node_config.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 14, 2024
1 parent 9dc1194 commit e42ff32
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions projects/PiNetAI/node/node_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import json

class NodeConfig:
def __init__(self, config_id, settings):
self.config_id = config_id
self.settings = settings

def apply(self):
with open(f'/etc/{self.config_id}.json', 'w') as f:
json.dump(self.settings, f)

def revert(self):
with open(f'/etc/{self.config_id}.json', 'r') as f:
self.settings = json.load(f)

0 comments on commit e42ff32

Please sign in to comment.