Kaydet (Commit) 6e3ff9f7 authored tarafından Bahadır Kandemir's avatar Bahadır Kandemir

Fail if profile name is too short

üst 537f832c
......@@ -20,6 +20,11 @@ from pardus import iniutils
NET_PATH = "/etc/network"
NET_STACK = "baselayout"
MSG_PROFILE_NAME = {
"en": "Profile name is too short.",
"tr": "Profil ismi çok kısa.",
}
INI = iniutils.iniParser(os.path.join(NET_PATH, script()))
def listProfiles():
......@@ -30,6 +35,8 @@ def listProfiles():
class Profile:
def __init__(self, name):
if not len(name):
fail(_(MSG_PROFILE_NAME))
self.name = name
try:
self.info = INI.getSection(name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment