def config_control():
 result = True
 comment = ''
 (changed, not_changed_reason) = config_changed()
 if (not changed):
  return (changed, not_changed_reason)
 try_commit = commit()
 if (not try_commit.get('result')):
  result = False
  comment = 'Unable to commit the changes: {reason}.\n        Will try to rollback now!'.format(reason=try_commit.get('comment'))
  try_rollback = rollback()
  if (not try_rollback.get('result')):
   comment += '\nCannot rollback! {reason}'.format(reason=try_rollback.get('comment'))
 return (result, comment)

def config_control ( ) : result = True comment = '' ( changed , not_changed_reason ) = config_changed ( ) if ( not changed ) : return ( changed , not_changed_reason ) try_commit = commit ( ) if ( not try_commit . get ( 'result' ) ) : result = False comment = 'Unable to commit the changes: {reason}.\n        Will try to rollback now!' . format ( reason = try_commit . get ( 'comment' ) ) try_rollback = rollback ( ) if ( not try_rollback . get ( 'result' ) ) : comment += '\nCannot rollback! {reason}' . format ( reason = try_rollback . get ( 'comment' ) ) return ( result , comment )
will check if the configuration was changed .