Package io.fathom.cloud

Examples of io.fathom.cloud.CloudException


            attachments.setProjectSecret(getClientApp(), auth, project, secret);
        } else {
            try {
                key = KeyczarUtils.unpack(secret);
            } catch (KeyczarException e) {
                throw new CloudException("Error unpacking key", e);
            }
        }

        return KeyczarUtils.buildCrypter(key);
    }
View Full Code Here


        OpenstackIdentityClient identityClient;
        try {
            identityClient = CertificateAuthTokenProvider.ensureRegistered(keypair, uri, email);
        } catch (RestClientException e) {
            throw new CloudException("Error registering with server", e);
        }

        String project;
        try {
            project = identityClient.getUtils().ensureProjectWithPrefix("__federation__");
        } catch (RestClientException e) {
            throw new CloudException("Error creating project", e);
        }

        backend.setBackendCookie(project);
    }
View Full Code Here

                return t;
            } catch (OptimisticLockException e) {
                log.warn("Retrying update after OptimisticLockException", e);
                continue;
            } catch (Exception e) {
                throw new CloudException("Error performing update", e);
            } finally {
                unitOfWork.end();
            }
        }
    }
View Full Code Here

    protected Sftp buildSftp(RemoteFile tempDir) throws CloudException {
        SftpChannel sftpChannel;
        try {
            sftpChannel = sshConfig.getSftpChannel();
        } catch (IOException e) {
            throw new CloudException("Error connecting to host", e);
        }
        return new Sftp(sftpChannel, tempDir);
    }
View Full Code Here

            }

            int mode = 0660;
            sftp.writeAtomic(new RemoteFile(confFile), ByteStreams.asByteSource(data), mode);
        } catch (IOException e) {
            throw new CloudException("Error updating applyd configuration", e);
        }
        return true;
    }
View Full Code Here

                return false;
            }

            sftp.delete(confFile);
        } catch (IOException e) {
            throw new CloudException("Error updating applyd configuration", e);
        }
        return true;
    }
View Full Code Here

        try {
            SshCommand sshCommand = new SshCommand(sshConfig, cmd);
            sshCommand.run();
        } catch (IOException e) {
            throw new CloudException("Error applying applyd configuration", e);
        }
    }
View Full Code Here

            process.Dir = hostFilesystem.getRootFs(containerId).getAbsolutePath();

            String json = new Gson().toJson(process);
            sftp.writeAtomic(new RemoteFile(processFile), json.getBytes(Charsets.UTF_8));
        } catch (IOException e) {
            throw new CloudException("Error starting container", e);
        }
    }
View Full Code Here

    private Sftp buildSftp(RemoteFile tempDir) throws CloudException {
        SftpChannel sftpChannel;
        try {
            sftpChannel = sshConfig.getSftpChannel();
        } catch (IOException e) {
            throw new CloudException("Error connecting to host", e);
        }
        return new Sftp(sftpChannel, tempDir);
    }
View Full Code Here

            // Don't use atomic... we don't have the right tmp, and we don't
            String lxcConfig = container.lxcConfig.build();
            WriteFile.with(sshConfig).from(lxcConfig).to(new File(configDir, "config.lxc")).run();
        } catch (IOException e) {
            throw new CloudException("Error creating container", e);
        }
    }
View Full Code Here

TOP

Related Classes of io.fathom.cloud.CloudException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.