Github user JPercivall commented on a diff in the pull request:

    https://github.com/apache/nifi-minifi/pull/45#discussion_r85127907
  
    --- Diff: 
minifi-toolkit/minifi-toolkit-configuration/src/main/java/org/apache/nifi/minifi/toolkit/configuration/ConfigMain.java
 ---
    @@ -235,62 +252,127 @@ private static void 
addRemoteProcessGroupPortDTOs(Map<String, String> connectabl
             }
         }
     
    +    public int upgrade(String[] args) {
    +        if (args.length != 3) {
    +            printUgradeUsage();
    +            return ERR_INVALID_ARGS;
    +        }
    +
    +        ConfigSchema configSchema = null;
    +        try (InputStream inputStream = 
pathInputStreamFactory.create(args[1])) {
    +            try {
    +                configSchema = 
SchemaLoader.loadConfigSchemaFromYaml(inputStream);
    +            } catch (IOException|SchemaLoaderException e) {
    +                return handleErrorLoadingConfiguration(e, 
ConfigMain::printUgradeUsage);
    +            }
    +        } catch (FileNotFoundException e) {
    +            return handleErrorOpeningInput(args[1], 
ConfigMain::printUgradeUsage, e);
    +        } catch (IOException e) {
    +            handleErrorClosingInput(e);
    +        }
    +
    +        try (OutputStream fileOutputStream = 
pathOutputStreamFactory.create(args[2])) {
    +            try {
    +                SchemaSaver.saveConfigSchema(configSchema, 
fileOutputStream);
    +            } catch (IOException e) {
    +                return handleErrorSavingCofiguration(e);
    +            }
    +        } catch (FileNotFoundException e) {
    +            return handleErrorOpeningOutput(args[2], 
ConfigMain::printUgradeUsage, e);
    +        } catch (IOException e) {
    +            handleErrorClosingOutput(e);
    +        }
    +
    +        return SUCCESS;
    --- End diff --
    
    This should run a validate on the resulting upgraded file. I ran a test 
where I upgraded a flow with a connection that was missing a destination and I 
was confused when it didn't tell there were problems.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to