Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Print messages on success of some DTRS operations
Browse files Browse the repository at this point in the history
  • Loading branch information
priteau committed Dec 7, 2012
1 parent 6009702 commit 11913f5
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions ceiclient/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading DT definition file %s: %s" % (opts.dt_def_file, e))

return client.add_dt(opts.caller, opts.dt_name, dt_def)
client.add_dt(opts.caller, opts.dt_name, dt_def)
return "Added DT %s for user %s" % (opts.dt_name, opts.caller)


class DTRSDescribeDT(CeiCommand):
Expand Down Expand Up @@ -112,7 +113,8 @@ def __init__(self, subparsers):

@staticmethod
def execute(client, opts):
return client.remove_dt(opts.caller, opts.dt_name)
client.remove_dt(opts.caller, opts.dt_name)
return "Removed DT %s for user %s" % (opts.dt_name, opts.caller)


class DTRSUpdateDt(CeiCommandPrintOutput):
Expand All @@ -135,7 +137,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading DT definition file %s: %s" % (opts.dt_def_file, e))

return client.update_dt(opts.caller, opts.dt_name, dt_def)
client.update_dt(opts.caller, opts.dt_name, dt_def)
return "Updated DT %s for user %s" % (opts.dt_name, opts.caller)


class DTRSAddSite(CeiCommandPrintOutput):
Expand All @@ -158,7 +161,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading site definition file %s: %s" % (opts.site_def_file, e))

return client.add_site(opts.site_name, site_def)
client.add_site(opts.site_name, site_def)
return "Added site %s" % opts.site_name


class DTRSDescribeSite(CeiCommand):
Expand Down Expand Up @@ -196,7 +200,8 @@ def __init__(self, subparsers):

@staticmethod
def execute(client, opts):
return client.remove_site(opts.site_name)
client.remove_site(opts.site_name)
return "Removed site %s" % opts.site_name


class DTRSUpdateSite(CeiCommandPrintOutput):
Expand All @@ -219,7 +224,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading site definition file %s: %s" % (opts.site_def_file, e))

return client.update_site(opts.site_name, site_def)
client.update_site(opts.site_name, site_def)
return "Updated site %s" % opts.site_name


class DTRSAddCredentials(CeiCommandPrintOutput):
Expand All @@ -242,7 +248,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading credentials definition file %s: %s" % (opts.credentials_def_file, e))

return client.add_credentials(opts.caller, opts.site_name, credentials_def)
client.add_credentials(opts.caller, opts.site_name, credentials_def)
return "Added credentials of site %s for user %s" % (opts.site_name, opts.caller)


class DTRSDescribeCredentials(CeiCommand):
Expand Down Expand Up @@ -280,7 +287,8 @@ def __init__(self, subparsers):

@staticmethod
def execute(client, opts):
return client.remove_credentials(opts.caller, opts.site_name)
client.remove_credentials(opts.caller, opts.site_name)
return "Removed credentials of site %s for user %s" % (opts.site_name, opts.caller)


class DTRSUpdateCredentials(CeiCommandPrintOutput):
Expand All @@ -303,7 +311,8 @@ def execute(client, opts):
except Exception, e:
raise CeiClientError("Problem reading credentials definition file %s: %s" % (opts.credentials_def_file, e))

return client.update_credentials(opts.caller, opts.site_name, credentials_def)
client.update_credentials(opts.caller, opts.site_name, credentials_def)
return "Updated credentials of site %s for user %s" % (opts.site_name, opts.caller)


class AddDomain(CeiCommand):
Expand Down

0 comments on commit 11913f5

Please sign in to comment.