code: def save_configs(self):
          
  
          try:
              config_path = os.path.join(self._working_directory, "configs")
              os.makedirs(config_path, exist_ok=True)
          except OSError as e:
              raise DynamipsError("Could could not create configuration directory {}: {}".format(config_path, e))
  
          startup_config_base64, private_config_base64 = yield from self.extract_config()
          if startup_config_base64:
              startup_config = self.startup_config_path
              try:
                  config = base64.b64decode(startup_config_base64).decode("utf-8", errors="replace")
                  config = "!\n" + config.replace("\r", "")
                  config_path = os.path.join(self._working_directory, startup_config)
                  with open(config_path, "wb") as f:
                      log.info("saving startup-config to {}".format(startup_config))
                      f.write(config.encode("utf-8"))
              except (binascii.Error, OSError) as e:
                  raise DynamipsError("Could not save the startup configuration {}: {}".format(config_path, e))
  
          if private_config_base64 and base64.b64decode(private_config_base64) != b'\nkerberos password \nend\n':
              private_config = self.private_config_path
              try:
                  config = base64.b64decode(private_config_base64).decode("utf-8", errors="replace")
                  config_path = os.path.join(self._working_directory, private_config)
                  with open(config_path, "wb") as f:
                      log.info("saving private-config to {}".format(private_config))
                      f.write(config.encode("utf-8"))
              except (binascii.Error, OSError) as e:
                  raise DynamipsError("Could not save the private configuration {}: {}".format(config_path, e))
docs: Saves the startup-config and private-config to files.