original_docstring: Create a group on OneFS and in the local script.
docstring: Create a group on OneFS and in the local script.
docstring_tokens: Create a group on OneFS and in the local script .
code: def create_group(self, group_name):
          """Create a group on OneFS and in the local script."""
          while True:
              try:
                  gid = self.next_gid
                  LOGGER.info(
                      'Creating the %s group with GID %s on %s...',
                      group_name,
                      gid,
                      self.onefs.address,
                  )
                  self.onefs.create_group(name=group_name, gid=gid, zone=self.onefs_zone)
                  break
              except isilon_hadoop_tools.onefs.APIError as exc:
                  if exc.gid_already_exists_error(gid):
                      LOGGER.warning(exc.gid_already_exists_error_format.format(gid))
                      continue
                  if exc.group_already_exists_error(group_name):
                      LOGGER.warning(exc.group_already_exists_error_format.format(group_name))
                      gid = self.onefs.gid_of_group(group_name=group_name, zone=self.onefs_zone)
                      break
                  raise
          if self.script_path:
              self._create_script()
              LOGGER.info(
                  'Creating the %s group with GID %s in %s...',
                  group_name,
                  gid,
                  self.script_path,
              )
              with open(self.script_path, 'a') as script_file:
                  script_file.write('groupadd --gid {gid} {name}\n'.format(gid=gid, name=group_name))
          return gid
code_tokens: def create_group ( self , group_name ) : while True : try : gid = self . next_gid LOGGER . info ( 'Creating the %s group with GID %s on %s...' , group_name , gid , self . onefs . address , ) self . onefs . create_group ( name = group_name , gid = gid , zone = self . onefs_zone ) break except isilon_hadoop_tools . onefs . APIError as exc : if exc . gid_already_exists_error ( gid ) : LOGGER . warning ( exc . gid_already_exists_error_format . format ( gid ) ) continue if exc . group_already_exists_error ( group_name ) : LOGGER . warning ( exc . group_already_exists_error_format . format ( group_name ) ) gid = self . onefs . gid_of_group ( group_name = group_name , zone = self . onefs_zone ) break raise if self . script_path : self . _create_script ( ) LOGGER . info ( 'Creating the %s group with GID %s in %s...' , group_name , gid , self . script_path , ) with open ( self . script_path , 'a' ) as script_file : script_file . write ( 'groupadd --gid {gid} {name}\n' . format ( gid = gid , name = group_name ) ) return gid
short_docstring: Create a group on OneFS and in the local script.
short_docstring_tokens: Create a group on OneFS and in the local script .
comment: """Create a group on OneFS and in the local script."""