Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions cli/src/device/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,14 @@ def create(self) -> None:

def change_permission(self) -> None:
kvm_path = "/dev/kvm"
if os.path.exists(kvm_path):
cmds = (f"sudo chown 1300:1301 {kvm_path}",
"sudo sed -i '1d' /etc/passwd")
for c in cmds:
subprocess.check_call(c, shell=True)
self.logger.info("KVM permission is granted!")
else:
if not os.path.exists(kvm_path):
raise RuntimeError("/dev/kvm cannot be found!")

subprocess.check_call(
f"sudo chown 1300:1301 {kvm_path}",
shell=True
)
self.logger.info("KVM permission is granted!")

def deploy(self):
self.logger.info(f"Deploying the {self.device_type}")

Expand Down