-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8f5198
commit 7ddc32d
Showing
6 changed files
with
59 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use crate::lib::error::DfxResult; | ||
use crate::lib::provider::{create_network_descriptor, LocalBindDetermination}; | ||
use crate::util::network::get_running_replica_port; | ||
use crate::Environment; | ||
|
||
use anyhow::bail; | ||
|
||
pub(crate) fn get_replica_port(env: &dyn Environment) -> DfxResult<String> { | ||
let network_descriptor = create_network_descriptor( | ||
env.get_config(), | ||
env.get_networks_config(), | ||
None, | ||
None, | ||
LocalBindDetermination::AsConfigured, | ||
)?; | ||
|
||
if let Some(port) = | ||
get_running_replica_port(None, network_descriptor.local_server_descriptor()?)? | ||
{ | ||
Ok(format!("{}", port)) | ||
} else { | ||
bail!("No replica port found"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters