-
Notifications
You must be signed in to change notification settings - Fork 7
Retrieve diagnostics (for review purpose) #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve diagnostics (for review purpose) #14
Conversation
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice concepts you use. I do not see the overall yet, but it looks promissing
| HashMap<DiagnosticsKey.DiagnosticsType, Set<DiagnosticsKey<?>>> _diagnosticsTypeLevelsMap = new HashMap<DiagnosticsKey.DiagnosticsType, Set<DiagnosticsKey<?>>>(); | ||
|
|
||
|
|
||
| \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happened here? seems syntactically fine but kind of strange formatting
| s_logger.debug("Retrieving keys from " + configurable.getClass().getSimpleName()); | ||
|
|
||
| for (DiagnosticsKey<?> key : configurable..etConfigKeys()) { | ||
| for (DiagnosticsKey<?> key : configurable. . ..get.get.getConfigKeys()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some artifact that wasn't intended?
|
|
||
|
|
||
|
|
||
| /* public ConfigKey.Scope scope() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment need not be, as we use a versioning system
| import org.apache.cloudstack.framework.config.ConfigDepot; | ||
| import org.apache.cloudstack.framework.config.ConfigDepotAdmin; | ||
| import org.apache.cloudstack.framework.config.impl.ConfigDepotImpl; | ||
| import org.apache.cloudstack.framework.config.ScopedConfigStorage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot find this class. is it checked in?
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how you use the concept of generics. I also see what you are trying to achieve with it. I hope you are not making it to complicated for yourself. We are going to need a lot of unit and integration tests for this to have a clean end result.
| import org.apache.cloudstack.framework.config.ConfigDepot; | ||
| import org.apache.cloudstack.framework.config.ConfigDepotAdmin; | ||
| import org.apache.cloudstack.framework.config.ScopedConfigStorage; | ||
| import org.apache.cloudstack.framework.config.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new one?
| @Override | ||
| public <T> void set(ConfigKey<T> key, T value) { | ||
| _configDao.update(key.key(), value.toString()); | ||
| //_diagnosticsDao.update(key.key(), value.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| @Override | ||
| public <T> void createOrUpdateConfigObject(String componentName, ConfigKey<T> key, String value) { | ||
| createOrupdateConfigObject(new Date(), componentName, key, value); | ||
| //createOrupdateConfigObject(new Date(), componentName, key, value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| public DiagnosticsKey(String role, DiagnosticsEntryType diagnosticstype, String description) { | ||
| _role = role; | ||
| _diagnosticsType = diagnosticstype; | ||
| /* public DiagnosticsKey(Class<T> type, String name, String description) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| } | ||
| } | ||
|
|
||
| /* public static DiagnosticsKey<?> getDiagnosticsClassKeys() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| //get list of default files from the database table for this diagnostics type | ||
| } else { | ||
| throw new InvalidParameterValueException("Invalid parameters"); | ||
| // System.exit(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the branch still doesn't compile for me.
|
|
||
| public RetrieveDiagnosticsVO(String roleId, String role, String className, String value) { | ||
| this.roleId = roleId; | ||
| /* public RetrieveDiagnosticsVO(String roleId, String role, String className, String value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no code in comment please
| } | ||
|
|
||
| public void setClassName(String className) { | ||
| public void setDiagnosticsType(String className) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
|
||
| public interface RetrieveDiagnosticsService extends Manager, PluggableService { | ||
|
|
||
| ConfigKey<Long> RetrieveDiagnosticsTimeOut = new ConfigKey<Long>("Advanced", Long.class, "retrieveDiagnostics.retrieval.timeout", "3600", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why move to the Impl? isn't it fine here?
| "The interval between garbage collection executions in seconds", true, ConfigKey.Scope.Global); | ||
|
|
||
|
|
||
| /* DiagnosticsKey<String> IPTablesRemove = new DiagnosticsKey<String>(String.class, "IPtables.remove", "The IPtables rules to be removed", null, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove code instead of commenting it out. we have a versioning system to retrieve old code.
35eecfd to
9892e79
Compare
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a new high-level pass on the whole of it. I have two main questions:
- naming in general needs attention. Can we improve on that a bit.
- I want to see why you created the generic. What is your purpose for it?
|
|
||
| RetrieveDiagnosticsResponse getDiagnosticsFiles(final RetrieveDiagnosticsCmd cmd) throws InvalidParameterValueException, ConfigurationException; | ||
|
|
||
| ConfigKey<?>[] getConfigKeys(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method shouldn't be declared here. It is part of interface Configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed ConfigKey<?> getConfigKeys() from ServiceImpl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should remain in the ServiceImpl, @charles-phiri . But it shouldn't be in this interface. It is already defined in Configerable.
| public static final String EVENT_SSVM_STOP = "SSVM.STOP"; | ||
| public static final String EVENT_SSVM_REBOOT = "SSVM.REBOOT"; | ||
| public static final String EVENT_SSVM_HA = "SSVM.HA"; | ||
| public static final String EVENT_SSVM_DIAGNOSTICS = "SSVM.DIAGNOSTICS"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EVENT_SSVM_DIAGNOSTICS is not used outside this file. Do we really need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed EVENT_SSVM_DIAGNOSTICS
| INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 4, 'moveNetworkAclItem', 'ALLOW', 260) ON DUPLICATE KEY UPDATE rule=rule; | ||
| INSERT INTO `cloud`.`role_permissions` (`uuid`, `role_id`, `rule`, `permission`, `sort_order`) values (UUID(), 4, 'moveNetworkAclItem', 'ALLOW', 260) ON DUPLICATE KEY UPDATE rule=rule; | ||
|
|
||
| CREATE TABLE `cloud`.`diagnosticsdata` ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this more of a 'diagnostics_defaults' or 'diagnostics_configuration'? I don't think the name diagnosticsdata is right for this table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a matter of preference. The name was suggested by Dag....don't know what you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diagnostics data to me suggests that the result of any action or gathering is in this table, as opposed to it containing a means of steering how gathering is done. Hence my two suggestions. I am not religious obout those two, but I think the name diagnosticsdata is misleading.
|
|
||
| private void createOrupdateDiagnosticsObject(String componentName, DiagnosticsKey<?> diagnosticsType) { | ||
| RetrieveDiagnosticsVO vo = _diagnosticsDao.findById(diagnosticsType.key()); | ||
| //DiagnosticsKey diagnosticsKey = new DiagnosticsKey(diagnosticsType.getClass(), diagnosticsType.key(), "new diagnostics") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
|
|
||
| private final static Logger s_logger = Logger.getLogger(DiagnosticsConfigDepotImpl.class); | ||
| @Inject | ||
| RetrieveDiagnosticsDao _diagnosticsDao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need the antiquated convention of prefix '_' on member names.
|
|
||
| } else { | ||
| throw new InvalidParameterValueException("Invalid parameters"); | ||
| // System.exit(-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
|
|
||
| public DiagnosticsKey<?>[] getDiagnosticsConfigKeys() | ||
| { | ||
| return null; //new DiagnosticsKey<?>[] { IPTablesRemove, IPTablesRetrieve, LOGFILES, PROPERTYFILES, DNSFILES, DHCPFILES, USERDATA, LB, VPN }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| return cmdList; | ||
| } | ||
|
|
||
| /* public SecondaryStorageVmVO startSecondaryStorageVm(long secStorageVmId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code in comment
| if (fileDetails != null) { | ||
| filesToRetrieve = fileDetails.split(","); | ||
| } else { | ||
| filesToRetrieve = null;//retrieve default files from db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment a TODO?
| 'cloudian': 'Cloudian', | ||
| 'Sioc' : 'Sioc' | ||
| 'Sioc' : 'Sioc', | ||
| 'retrieveDiagnostics': 'System VM' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the right tag/token? it seems to me that it deserves its own class. It will also be applicable to hosts in the future (maybe)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation, it looks to me like it is the right file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is the right file. I wonder about the value of the tag, not the place it is defined
DaanHoogland
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far, now.
pleae push further changes asap.
| @@ -0,0 +1,59 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the nested comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| * // under the License. | ||
| */ | ||
|
|
||
| // Licensed to the Apache Software Foundation (ASF) under one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
three licenses is a bit overdone
| @@ -0,0 +1,90 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue as in answer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| public RetrieveDiagnosticsService getRetrieveDiagnosticsService() { | ||
| return retrieveDiagnosticsService; | ||
| public static Logger getS_logger() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why an accessor for the logger? it is only used locally isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also it should be called LOGGER or LOG as it is static final. and not have the obsoleted 's_' prefix
|
|
||
| public void setRetrieveDiagnosticsService(RetrieveDiagnosticsService retrieveDiagnosticsService) { | ||
| this.retrieveDiagnosticsService = retrieveDiagnosticsService; | ||
| public static String getAPINAME() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not to be accessed outside the class is it?
| INSERT INTO `cloud`.`diagnosticsdata` (`role`, `class`, `value`) values ('VR', 'VPN', '<vpn configuration file>'); | ||
| INSERT INTO `cloud`.`diagnosticsdata` (`role`, `class`, `value`) values ('VR', 'LOGFILES', 'cloud.log,agent.log'); | ||
| INSERT INTO `cloud`.`diagnosticsdata` (`role`, `class`, `value`) values ('CPVM', 'PROPERTYFILES', '<CPVM property file>'); | ||
| INSERT INTO `cloud`.`diagnosticsdata` (`role`, `class`, `value`) values ('SecondaryStorageVm', 'LOGFILES', 'cloud.log,agent.log,[IPTABLES]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| @@ -0,0 +1,38 @@ | |||
| /* | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the nesting in the comment, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it is still here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed it. Will make a push soon after completing the code I am working on.
| @@ -0,0 +1,62 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the nesting in the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you didn't commit it?
| private Date lastSent; | ||
|
|
||
| @SerializedName(ApiConstants.TIMEOUT) | ||
| @Param(description = "the timeout (in seconds) for requests to the retrieve diagnostics API") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of this in the response? i.e. what information does the user get from this response field?
| entityEventDetails.put(EVENT_SSVM_STOP, VirtualMachine.class); | ||
| entityEventDetails.put(EVENT_SSVM_REBOOT, VirtualMachine.class); | ||
| entityEventDetails.put(EVENT_SSVM_HA, VirtualMachine.class); | ||
| entityEventDetails.put(EVENT_SSVM_DIAGNOSTICS, VirtualMachine.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when is this fired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it but I think we might need Events at a later stage.
| RetrieveDiagnosticsResponse retrieveDiagnosticsResponse = new RetrieveDiagnosticsResponse(); | ||
| try { | ||
| retrieveDiagnosticsService.getDiagnosticsFiles(this); | ||
| retrieveDiagnosticsResponse.setObjectName("retrievediagnostics"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this the ideal object name? did you have other names considdered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What can you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"diagnostics" maybe? or retrievedlogs, diagnosticsinformation. diagnosticdata.
I am really not sure it is a sincere question. It is just that retrievediagnostics (which is a spelling error btw, only one d) does not seem right.
from wiktionary: diagnostics
plural of diagnostic
The process of determining the state of or capability of a component to perform its function(s).
retrieving a process is not intuitively right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think diagnosticsinformation makes sense. Do you want me to change the whole class or just retrieveDiagnosticsResponse.setObjectName("retrievediagnostics");
|
|
||
| @Override | ||
| public String getEventDescription() { | ||
| return "Retrieved diagnostics files from System VM =" + id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"System VM =" may be too specific if we add hosts or hardware loadbalancers. We might go for "host: ". What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfectly makes sense
| // under the License. | ||
| package org.apache.cloudstack.api.command.admin.systemvm; | ||
|
|
||
| import org.apache.log4j.Logger; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is only imports chaged in this file. consider reverting it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted it.
| } | ||
|
|
||
| @Override | ||
| public boolean isQuery() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please look at the formatting here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
| @Component | ||
| public class RetrieveDiagnosticsDaoImpl extends GenericDaoBase<RetrieveDiagnosticsVO, String> implements RetrieveDiagnosticsDao | ||
| { | ||
| private final SearchBuilder<RetrieveDiagnosticsVO> DiagnosticsSearchByType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you check if we need this, please. it is not used in the class or in its interface. I think you blindly copied my code from annotations and I should have removed it there myself. I am not sure, though.
| import java.util.HashMap; | ||
| import java.util.List; | ||
|
|
||
| public class DiagnosticsConfigDepotImpl implements DiagnosticsConfigDepot { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name depot is not very fortunate. Please help think of a better one. I am thinking of just DiagnosticsConfiguration or DiagnosticsConfigurator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
|
||
| public class DiagnosticsConfigDepotImpl implements DiagnosticsConfigDepot { | ||
|
|
||
| private final static Logger s_logger = Logger.getLogger(DiagnosticsConfigDepotImpl.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the naming convention of s_ is obsolete, please use the name for a static final in all uppercase; i.e. LOG or LOGGER
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Will have to look at other classes and change as required.
| import java.util.HashMap; | ||
| import java.util.List; | ||
|
|
||
| public interface DiagnosticsConfigDepot { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming is a bit off. please see the -Impl for discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to discuss this so that I can learn the naming conversion. Meanwhile, I will leave it as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you mean convention, right? I am not sure there is a convention for what you are trying to do here yet. That would mean we are free to choose. Of course with that freedom comes great responsibility ;) I must be intuitively right.
| @Parameter(name = ApiConstants.ID, | ||
| type = CommandType.UUID, | ||
| entityType = RetrieveDiagnosticsResponse.class, | ||
| entityType = DomainRouterResponse.class, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this call is now only valid for DomainRouters? using the DomainRouterResponse.class...? I think something went wrong here
| public class RetrieveDiagnosticsDaoImpl extends GenericDaoBase<RetrieveDiagnosticsVO, String> implements RetrieveDiagnosticsDao | ||
| { | ||
| private final SearchBuilder<RetrieveDiagnosticsVO> DiagnosticsSearchByType; | ||
| // private final SearchBuilder<RetrieveDiagnosticsVO> DiagnosticsSearchByType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did it work, without? (just remove, git will find it back if you need it;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it did work thanks
| @@ -0,0 +1,24 @@ | |||
|
|
|||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still nested comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
borisstoyanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a marvin test?
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any reason we need that many empty lines?
|
|
||
| protected Answer copyFileFromSystemVm(final NetworkElementCommand cmd, String script) throws Exception { | ||
| final File keyFile = getSystemVMKeyFile(); | ||
| private CreateEntityDownloadURLAnswer downloadCompressedFileToSSVM(CreateEntityDownloadURLCommand cmd, final String diagnosticsZipFileName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you break this up in smaller methods?
i.e. checkApache(), mkdirCommand(), linkCommand() etc...
| private String secUrl; | ||
|
|
||
| @Inject | ||
| NetworkModel _networkModel; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the name
| NetworkModel _networkModel; | ||
|
|
||
| @Inject | ||
| NetworkDao _networksDao = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the name
| NetworkDao _networksDao = null; | ||
|
|
||
| @Inject | ||
| NicDao _nicDao = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the name
| NicDao _nicDao = null; | ||
|
|
||
| @Inject | ||
| private HostDao _hostDao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the names, here and below
| private VirtualMachineManager vmManager; | ||
|
|
||
| @Inject | ||
| protected DataCenterDao _dcDao = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the name
| protected DataCenterDao _dcDao = null; | ||
|
|
||
| @Inject | ||
| protected PrimaryDataStoreDao _storagePoolDao = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the underscore from the name
| } | ||
| final Long vmId = cmd.getId(); | ||
| vmInstance = _vmDao.findByIdTypes(vmId, VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.DomainRouter, VirtualMachine.Type.SecondaryStorageVm); | ||
| //vmInstance.getDetails() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove code in comment
| @@ -0,0 +1,52 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a nested comment, please use either /* */ or //
| @@ -0,0 +1,29 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove nested comment
| NicDao _nicDao = null; | ||
|
|
||
| @Inject | ||
| private HostDao _hostDao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the _ from this field and all those below
| filesToRetrieve.add(files[i]); | ||
| } | ||
| } | ||
| // ManagementServerHostVO managementServerHostVO = managementServerHostDao.findById(systemVmId..getHostId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| } | ||
| } | ||
| // ManagementServerHostVO managementServerHostVO = managementServerHostDao.findById(systemVmId..getHostId()); | ||
| //String ipHostAddress = managementServerHostVO.getServiceIP(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| RetrieveFilesCommand retrieveFilesCommand = null; | ||
| Map<String, String> resultsMap; | ||
| final Long hostId = systemVmId.getHostId(); | ||
| //Answer answer = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| if (store == null) { | ||
| throw new CloudRuntimeException("cannot find an image store for zone " + zoneId); | ||
| } | ||
| //DataStoreTO destStoreTO = store.getTO(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| @@ -0,0 +1,228 @@ | |||
| /* | |||
| * // Licensed to the Apache Software Foundation (ASF) under one | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove nested comments
|
|
||
| } | ||
|
|
||
| Map<String, String> resultsMap = new HashMap<>();//retrieveDiagnosticsService.getDiagnosticsFiles(retrieveDiagnosticsCmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the commented code at the end of this line
| except OSError as e: | ||
| print("Failed to create directory temp") | ||
|
|
||
| #manifest_file = open("temp/" + "manifest.txt", "w+") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| print filename + " not found" | ||
| #manifest_file.write(filename + " not found.") | ||
|
|
||
| #zip_archive.write(manifest_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| #manifest_file.write(filename + " not found.") | ||
|
|
||
| #zip_archive.write(manifest_file) | ||
| #manifest_file.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented code
| save_files = SaveIptablesToLogFile(arguments) | ||
| save_files.ensure_dir(file_path) | ||
| save_files.saveIpTableEntries(file_path) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too many extra lines
|
@charles-phiri please rebase to resolve conflicts and make sure the build passes |
No description provided.